From patchwork Wed Nov 10 23:10:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12613601 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34C0CC433FE for ; Wed, 10 Nov 2021 23:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1851161267 for ; Wed, 10 Nov 2021 23:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234161AbhKJX21 (ORCPT ); Wed, 10 Nov 2021 18:28:27 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:34883 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233965AbhKJX21 (ORCPT ); Wed, 10 Nov 2021 18:28:27 -0500 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Wed, 10 Nov 2021 18:28:26 EST Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 10 Nov 2021 15:10:30 -0800 Received: from vypre.local.home (unknown [10.21.244.28]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 24C7E2056D; Wed, 10 Nov 2021 15:10:35 -0800 (PST) From: Steven Rostedt To: CC: "Steven Rostedt (VMware)" Subject: [PATCH 1/2] tracefs Documentation: Fix tracefs_hist_add_sort_key() example Date: Wed, 10 Nov 2021 18:10:24 -0500 Message-ID: <20211110231025.1131051-2-rostedt@goodmis.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211110231025.1131051-1-rostedt@goodmis.org> References: <20211110231025.1131051-1-rostedt@goodmis.org> MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: rostedt@goodmis.org does not designate permitted sender hosts) Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The tracefs_hist_add_sort_key() example in the man page had the old usage of variable args. Update it to use the new "one at a time" version. Signed-off-by: Steven Rostedt (VMware) --- Documentation/libtracefs-hist.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/libtracefs-hist.txt b/Documentation/libtracefs-hist.txt index 0139ba8..cc82286 100644 --- a/Documentation/libtracefs-hist.txt +++ b/Documentation/libtracefs-hist.txt @@ -282,7 +282,8 @@ int main (int argc, char **argv, char **env) } ret = tracefs_hist_add_value(hist, "bytes_alloc"); - ret |= tracefs_hist_add_sort_key(hist, "bytes_req", "bytes_alloc", NULL); + ret |= tracefs_hist_add_sort_key(hist, "bytes_req"); + ret |= tracefs_hist_add_sort_key(hist, "bytes_alloc"); ret |= tracefs_hist_sort_key_direction(hist, "bytes_alloc", TRACEFS_HIST_SORT_DESCENDING); From patchwork Wed Nov 10 23:10:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12613603 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2379AC433EF for ; Wed, 10 Nov 2021 23:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 087246112E for ; Wed, 10 Nov 2021 23:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234160AbhKJX21 (ORCPT ); Wed, 10 Nov 2021 18:28:27 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:34883 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233964AbhKJX20 (ORCPT ); Wed, 10 Nov 2021 18:28:26 -0500 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Wed, 10 Nov 2021 18:28:26 EST Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 10 Nov 2021 15:10:31 -0800 Received: from vypre.local.home (unknown [10.21.244.28]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id D13F92056F; Wed, 10 Nov 2021 15:10:35 -0800 (PST) From: Steven Rostedt To: CC: "Steven Rostedt (VMware)" Subject: [PATCH 2/2] tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key() Date: Wed, 10 Nov 2021 18:10:25 -0500 Message-ID: <20211110231025.1131051-3-rostedt@goodmis.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211110231025.1131051-1-rostedt@goodmis.org> References: <20211110231025.1131051-1-rostedt@goodmis.org> MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: rostedt@goodmis.org does not designate permitted sender hosts) Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The commit log that added tracefs_hist_reset_sort_key() called it tracefs_hist_set_sort_key(), and that seems to be a better name. Signed-off-by: Steven Rostedt (VMware) --- Documentation/libtracefs-hist.txt | 8 ++++---- include/tracefs.h | 4 ++-- src/tracefs-hist.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/libtracefs-hist.txt b/Documentation/libtracefs-hist.txt index cc82286..cc6b859 100644 --- a/Documentation/libtracefs-hist.txt +++ b/Documentation/libtracefs-hist.txt @@ -4,7 +4,7 @@ libtracefs(3) NAME ---- tracefs_hist_alloc, tracefs_hist_free, tracefs_hist_add_key, tracefs_hist_add_value, tracefs_hist_add_name, tracefs_hist_start, -tracefs_hist_destory, tracefs_hist_add_sort_key, tracefs_hist_reset_sort_key,tracefs_hist_sort_key_direction - Create and update event histograms +tracefs_hist_destory, tracefs_hist_add_sort_key, tracefs_hist_set_sort_key,tracefs_hist_sort_key_direction - Create and update event histograms SYNOPSIS -------- @@ -28,8 +28,8 @@ int tracefs_hist_add_key(struct tracefs_hist pass:[*]hist, const char pass:[*]ke int tracefs_hist_add_value(struct tracefs_hist pass:[*]hist, const char pass:[*]value); int tracefs_hist_add_sort_key(struct tracefs_hist pass:[*]hist, const char pass:[*]sort_key); -int tracefs_hist_reset_sort_key(struct tracefs_hist pass:[*]hist, - const char pass:[*]sort_key, ...); +int tracefs_hist_set_sort_key(struct tracefs_hist pass:[*]hist, + const char pass:[*]sort_key, ...); int tracefs_hist_sort_key_direction(struct tracefs_hist pass:[*]hist, const char pass:[*]sort_key, enum tracefs_hist_sort_direction dir); @@ -104,7 +104,7 @@ that must match either an already defined key of the histogram, or an already defined value. If _hist_ already has sorting keys (previously added) the new _sort_key_ will have lower priority(be secondary or so on) when sorting. -*tracefs_hist_reset_sort_key*() will reset the list of key to sort on. The _hist_ is +*tracefs_hist_set_sort_key*() will reset the list of key to sort on. The _hist_ is the histrogram descriptor to reset the sort key to. The _sort_key_ is a string that must match either an already defined key of the histogram, or an already defined value. Multiple sort keys may be added to denote a secondary, sort order diff --git a/include/tracefs.h b/include/tracefs.h index ebe83fe..32420eb 100644 --- a/include/tracefs.h +++ b/include/tracefs.h @@ -337,8 +337,8 @@ int tracefs_hist_add_key(struct tracefs_hist *hist, const char *key, int tracefs_hist_add_value(struct tracefs_hist *hist, const char *value); int tracefs_hist_add_sort_key(struct tracefs_hist *hist, const char *sort_key); -int tracefs_hist_reset_sort_key(struct tracefs_hist *hist, - const char *sort_key, ...); +int tracefs_hist_set_sort_key(struct tracefs_hist *hist, + const char *sort_key, ...); int tracefs_hist_sort_key_direction(struct tracefs_hist *hist, const char *sort_key, enum tracefs_hist_sort_direction dir); diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c index 27bab00..7745bca 100644 --- a/src/tracefs-hist.c +++ b/src/tracefs-hist.c @@ -477,7 +477,7 @@ int tracefs_hist_add_sort_key(struct tracefs_hist *hist, } /** - * tracefs_hist_reset_sort_key - set a key for sorting the histogram + * tracefs_hist_set_sort_key - set a key for sorting the histogram * @hist: The histogram to set the sort key to * @sort_key: The key to sort (and the strings after it) * Last one must be NULL. @@ -487,8 +487,8 @@ int tracefs_hist_add_sort_key(struct tracefs_hist *hist, * * Returns 0 on success, -1 on error. */ -int tracefs_hist_reset_sort_key(struct tracefs_hist *hist, - const char *sort_key, ...) +int tracefs_hist_set_sort_key(struct tracefs_hist *hist, + const char *sort_key, ...) { char **list = NULL; char **tmp;