From patchwork Fri Feb 24 05:45:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13150938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E05AC678D5 for ; Fri, 24 Feb 2023 05:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjBXFqC (ORCPT ); Fri, 24 Feb 2023 00:46:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjBXFqB (ORCPT ); Fri, 24 Feb 2023 00:46:01 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29E1158B49 for ; Thu, 23 Feb 2023 21:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677217561; x=1708753561; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=J4ddzLR+psc4696uSLVSdXy/gmpvIlpCfH9vfaohT5U=; b=gJPSl+MacqI3uTIud6drgQB+MIZ+D05RAMDDD3NwKpT+pPadsaNgLt/2 9NsalVlA5x6CijK+Iod0PyhEi62ruOhzg5sbE6J7rWvTZjxwyezP0apBh oUi4H+xCkm/YlIjYXgD+Nl4alMpRuUFRCnBlouxtj0B3r6ZR/YxCWgHLf j1GmI7hp6DsfCdPxoqGAM/eU142Heih+tye+ChqaA5Cng061Q4Xyz8wwX uQFEdmpDmpyPCrZQ6w2r71Zu4O6MxFZMvZIiOdyPyl7oFA3FIG4WWIPGD kQnebaL/NOzOB3l1jtCOW4J/0xm+afTDypuwEI/G8yxiGmz21TDbkMZON g==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="398137018" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="398137018" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 21:46:00 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="1001701697" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="1001701697" Received: from kwameopo-mobl1.amr.corp.intel.com (HELO vverma7-desk1.local) ([10.209.85.102]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 21:45:59 -0800 From: Vishal Verma Date: Thu, 23 Feb 2023 22:45:38 -0700 Subject: [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent MIME-Version: 1.0 Message-Id: <20230223-meson-build-fixes-v1-1-5fae3b606395@intel.com> References: <20230223-meson-build-fixes-v1-0-5fae3b606395@intel.com> In-Reply-To: <20230223-meson-build-fixes-v1-0-5fae3b606395@intel.com> To: linux-cxl@vger.kernel.org Cc: =?utf-8?q?Michal_Such=C3=A1nek?= , Dave Jiang , Dan Williams , Dan Williams , Vishal Verma , nvdimm@lists.linux.dev X-Mailer: b4 0.13-dev-ada30 X-Developer-Signature: v=1; a=openpgp-sha256; l=2196; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=J4ddzLR+psc4696uSLVSdXy/gmpvIlpCfH9vfaohT5U=; b=owGbwMvMwCXGf25diOft7jLG02pJDMk//MVt7mmtq5upI5NzTmrbNtcyt/T6q3sjjPuLP4jU5 X0VsI3tKGVhEONikBVTZPm75yPjMbnt+TyBCY4wc1iZQIYwcHEKwERS+xj+ClyvOVl2SeXF68n8 4WfSbxxymtkhe9j6e+XXHQdeHXUN38HIcGqDkWpqkLO6fOAO46j42duXy/CalzhXL8nmq990dGY 7NwA= X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org Distros vary on whether the above headers are placed in {prefix}/libtracefs/ or {prefix}/tracefs/, and likewise for traceevent. Since both of these libraries do ship with pkgconfig info to determine the exact include path, the respective #include statements can drop the {lib}trace{fs,event}/ prefix. Since the libraries are declared using meson's dependency() function, it already does the requisite pkgconfig parsing. Drop the above prefixes to allow the includes work on all distros. Link: https://github.com/pmem/ndctl/issues/234 Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json object") Fixes: 7b237bc7a8ae ("cxl: add a helper to go through all current events and parse them") Reported-by: Michal Suchánek Cc: Dave Jiang Cc: Dan Williams Signed-off-by: Vishal Verma Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang --- cxl/event_trace.c | 4 ++-- cxl/monitor.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cxl/event_trace.c b/cxl/event_trace.c index 76dd4e7..926f446 100644 --- a/cxl/event_trace.c +++ b/cxl/event_trace.c @@ -2,14 +2,14 @@ // Copyright (C) 2022, Intel Corp. All rights reserved. #include #include +#include #include #include #include #include #include #include -#include -#include +#include #include "event_trace.h" #define _GNU_SOURCE diff --git a/cxl/monitor.c b/cxl/monitor.c index 749f472..e3469b9 100644 --- a/cxl/monitor.c +++ b/cxl/monitor.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -16,8 +17,7 @@ #include #include #include -#include -#include +#include #include /* reuse the core log helpers for the monitor logger */ From patchwork Fri Feb 24 05:45:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13150939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 093B8C61DA3 for ; Fri, 24 Feb 2023 05:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjBXFqD (ORCPT ); Fri, 24 Feb 2023 00:46:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBXFqC (ORCPT ); Fri, 24 Feb 2023 00:46:02 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B81E58B70 for ; Thu, 23 Feb 2023 21:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677217561; x=1708753561; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=MUvhPFbGDL7SH+wbQDaoTiqZSJ3jpVUHgEMwcEpg3QM=; b=R/802dDkU2beP9SuEDkscI0LFlEZulLE9dj9pTY1j9Ht12rzfqOpJJ/0 J9XGhL+S9tLjJBBCZBaqsXMhgMV3BCT4IMZMnKYUU6VyOrMOI92M2aqR+ 93jCsTJ9wCBD6pc9/P69iZ4DbONSGc3+P03dEg8ciq4y95kyoeTqqDrhh +UypJ3f8VzFn/9kBGcxr+ALvR9OzLfpHa1fzWE4YW6HVs45G7RrVbgYVb Pbrd9TwrVlgeDquBZddCnXZ0Tkljyfdn3Cr+BNrLvEWcDsklbmpU/CJKC GHnd5Jv4VZ+QF+RF7ykKl5a5wkCvzdUGv+VCJzfhH47rh3QvwGQM/7WnK Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="398137023" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="398137023" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 21:46:00 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="1001701702" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="1001701702" Received: from kwameopo-mobl1.amr.corp.intel.com (HELO vverma7-desk1.local) ([10.209.85.102]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 21:46:00 -0800 From: Vishal Verma Date: Thu, 23 Feb 2023 22:45:39 -0700 Subject: [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() MIME-Version: 1.0 Message-Id: <20230223-meson-build-fixes-v1-2-5fae3b606395@intel.com> References: <20230223-meson-build-fixes-v1-0-5fae3b606395@intel.com> In-Reply-To: <20230223-meson-build-fixes-v1-0-5fae3b606395@intel.com> To: linux-cxl@vger.kernel.org Cc: =?utf-8?q?Michal_Such=C3=A1nek?= , Dave Jiang , Dan Williams , Dan Williams , Vishal Verma , nvdimm@lists.linux.dev X-Mailer: b4 0.13-dev-ada30 X-Developer-Signature: v=1; a=openpgp-sha256; l=1530; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=MUvhPFbGDL7SH+wbQDaoTiqZSJ3jpVUHgEMwcEpg3QM=; b=owGbwMvMwCXGf25diOft7jLG02pJDMk//MXnn1H5let/LfG9u9Gnxm28dZuLtDUeyuSsfn4lO aLBp5yjo5SFQYyLQVZMkeXvno+Mx+S25/MEJjjCzGFlAhnCwMUpABM5WcDIsF3OtG/a2mxhL8n4 4uPT7CseaDFNq/v3e+uc/ZkxKZ23rzEynEgzNd28O3k+S7x1XXKvMsM1E2Fn9Xee3LNeJfX8ZUp kBwA= X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org The json-c API json_object_new_uint64() is relatively new, and some distros may not have it available. There is already a wrapped version in util/json.h which falls back to the int64 API, based on meson's determination of the availability of the uint64 version at compile time. Replace the direct uint64 calls with this wrapped version. Link: https://github.com/pmem/ndctl/issues/233 Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json object") Reported-by: Michal Suchánek Cc: Dave Jiang Cc: Dan Williams Signed-off-by: Vishal Verma Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang --- cxl/event_trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cxl/event_trace.c b/cxl/event_trace.c index 926f446..db8cc85 100644 --- a/cxl/event_trace.c +++ b/cxl/event_trace.c @@ -25,7 +25,7 @@ static struct json_object *num_to_json(void *num, int elem_size, unsigned long f if (sign) return json_object_new_int64(*(int64_t *)num); else - return json_object_new_uint64(*(uint64_t *)num); + return util_json_new_u64(*(uint64_t *)num); } /* All others fit in a signed 64 bit */ @@ -98,7 +98,7 @@ static int cxl_event_to_json(struct tep_event *event, struct tep_record *record, } json_object_object_add(jevent, "event", jobj); - jobj = json_object_new_uint64(record->ts); + jobj = util_json_new_u64(record->ts); if (!jobj) { rc = -ENOMEM; goto err_jevent;