linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] libtracefs: APIs to read a trace event hist file
@ 2021-08-10 20:48 Steven Rostedt
  2021-08-10 20:48 ` [PATCH 1/9] tracefs: Add API tracefs_hist_data_parse() Steven Rostedt
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Steven Rostedt @ 2021-08-10 20:48 UTC (permalink / raw)
  To: linux-trace-devel
  Cc: linux-kernel, Tom Zanussi, Daniel Bristot de Oliveira,
	Masami Hiramatsu, Namhyung Kim, linux-rt-users, Clark Williams,
	Steven Rostedt (VMware)

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The hist trigger for trace events will create a histogram that can be read
in the trace event's hist file. The file is human readable ASCII format, but
that makes it difficult to process in programs. The tracefs_hist_data*()
functions convert the histogram ASCII format into structures that can be
processed and converted into tables.

This patch series creates an API to read and parse this data into machine
code readable structures that can then be processed. There's a working
program in the man page.

I found the parsing of the hist file to be somewhat trivial where I only
needed to implement flex to do most of the work and was able to avoid using
bison. That said, there are still some histograms that can fail to parse.
Namely, if any key has a comma (,) or a colon (:) in it. This includes exec
names if there's a program name with a comma or colon. This can be fixed with
a bit more clever tricks with the lexer, but I'll add those if this becomes
an issue.

This series is also in my personal github account here:

  https://github.com/rostedt/libtracefs/tree/read-hist

Steven Rostedt (VMware) (9):
  tracefs: Add API tracefs_hist_data_parse()
  libtracefs: Parse comment for hist data information
  libtracefs: Change hist_data_key type to flags
  libtracefs: Add API tracefs_hist_data_read()
  libtracefs: Add API tracefs_list_dup()
  libtracefs: Add APIs tracefs_hist_data_keys/value_names()
  libtracefs: Add API tracefs_hist_data_keys/values() and next_bucket()
  libtracefs: Have tracefs_hist_bucket_key flags save the type
  libtracefs: Add man pages for tracefs_hist_data functions

 Documentation/libtracefs-hist-data-2.txt |  346 +++++++
 Documentation/libtracefs-hist-data.txt   |  294 ++++++
 include/tracefs.h                        |   54 +
 src/Makefile                             |    7 +
 src/tracefs-hist-data.c                  | 1175 ++++++++++++++++++++++
 src/tracefs-utils.c                      |   26 +
 6 files changed, 1902 insertions(+)
 create mode 100644 Documentation/libtracefs-hist-data-2.txt
 create mode 100644 Documentation/libtracefs-hist-data.txt
 create mode 100644 src/tracefs-hist-data.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-09-10 16:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 20:48 [PATCH 0/9] libtracefs: APIs to read a trace event hist file Steven Rostedt
2021-08-10 20:48 ` [PATCH 1/9] tracefs: Add API tracefs_hist_data_parse() Steven Rostedt
2021-09-10 16:54   ` Daniel Bristot de Oliveira
2021-08-10 20:48 ` [PATCH 2/9] libtracefs: Parse comment for hist data information Steven Rostedt
2021-08-10 20:48 ` [PATCH 3/9] libtracefs: Change hist_data_key type to flags Steven Rostedt
2021-08-10 20:48 ` [PATCH 4/9] libtracefs: Add API tracefs_hist_data_read() Steven Rostedt
2021-08-10 20:48 ` [PATCH 5/9] libtracefs: Add API tracefs_list_dup() Steven Rostedt
2021-08-10 20:48 ` [PATCH 6/9] libtracefs: Add APIs tracefs_hist_data_keys/value_names() Steven Rostedt
2021-08-10 20:48 ` [PATCH 7/9] libtracefs: Add API tracefs_hist_data_keys/values() and next_bucket() Steven Rostedt
2021-08-10 20:48 ` [PATCH 8/9] libtracefs: Have tracefs_hist_bucket_key flags save the type Steven Rostedt
2021-08-10 20:48 ` [PATCH 9/9] libtracefs: Add man pages for tracefs_hist_data functions Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).