* [PATCH 0/2] tracefs: Make minor updates to histograms
@ 2021-11-10 23:10 Steven Rostedt
2021-11-10 23:10 ` [PATCH 1/2] tracefs Documentation: Fix tracefs_hist_add_sort_key() example Steven Rostedt
2021-11-10 23:10 ` [PATCH 2/2] tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key() Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2021-11-10 23:10 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Steven Rostedt (VMware)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Make some minor changes to the tracefs histogram logic that Yordan
made.
Based on:
https://patchwork.kernel.org/project/linux-trace-devel/list/?series=552199
Steven Rostedt (VMware) (2):
tracefs Documentation: Fix tracefs_hist_add_sort_key() example
tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key()
Documentation/libtracefs-hist.txt | 11 ++++++-----
include/tracefs.h | 4 ++--
src/tracefs-hist.c | 6 +++---
3 files changed, 11 insertions(+), 10 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] tracefs Documentation: Fix tracefs_hist_add_sort_key() example
2021-11-10 23:10 [PATCH 0/2] tracefs: Make minor updates to histograms Steven Rostedt
@ 2021-11-10 23:10 ` Steven Rostedt
2021-11-10 23:10 ` [PATCH 2/2] tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key() Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2021-11-10 23:10 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Steven Rostedt (VMware)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
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) <rostedt@goodmis.org>
---
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);
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key()
2021-11-10 23:10 [PATCH 0/2] tracefs: Make minor updates to histograms Steven Rostedt
2021-11-10 23:10 ` [PATCH 1/2] tracefs Documentation: Fix tracefs_hist_add_sort_key() example Steven Rostedt
@ 2021-11-10 23:10 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2021-11-10 23:10 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Steven Rostedt (VMware)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
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) <rostedt@goodmis.org>
---
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;
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-10 23:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 23:10 [PATCH 0/2] tracefs: Make minor updates to histograms Steven Rostedt
2021-11-10 23:10 ` [PATCH 1/2] tracefs Documentation: Fix tracefs_hist_add_sort_key() example Steven Rostedt
2021-11-10 23:10 ` [PATCH 2/2] tracefs: Rename tracefs_hist_reset_sort_key() tracefs_hist_set_sort_key() Steven Rostedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.