Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3 0/5] trace-cmd: SQL-like syntax for ftrace histograms configuration
@ 2020-02-26 16:31 Tzvetomir Stoyanov (VMware)
  2020-02-26 16:31 ` [PATCH v3 1/5] trace-cmd: Add new libtracefs API tracefs_instance_file_append() Tzvetomir Stoyanov (VMware)
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-02-26 16:31 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

Configuration of complex ftrace histograms could be hard, using the existing ftrace interface.
The "--sql" option is implemented to simplify this task. It uses a sql-like syntax to define
the histograms and generates necessary ftrace syntetic events and triggers. Each ftrace event
represents a sql tible, while the fields of this event are rows in the table.

Few trace-cmd library APIs are introduced in this patch set, used in the
sql parser logic:
  in libtracefs: tracefs_instance_file_append()
  in libtraceevent: new flag to suppress parsing warnings

The patch set is based on Steven Rostedt's PoC implementation:
   https://github.com/rostedt/sqlhist

[
 v3 changes:
  - Do not allocate tep handler in sqlparser library, pass it as input
    parameter to sqlhist_parse() API. The tep handler, initialized with
    all required ftarce events must, be supplied by the API caller.
  - Add tep handler to common_record_context of trace-cmd record and
    similar commands. Add logic to initialize and destroy it.
  - Implemented new traceevent API to suppress parsing error while
    reading ftrace events.
 v2 changes:
  - Removed patches for trace-cmd reset sub command from this patch set, as
    they are not directly related to the SQL-like syntax implementation.
  - Fixed the use case with more than one "--sql" argument. Added logic to
    clean up the parser state before parsing a new string.
  - Implemented API for freeing all resources, allocated by the parser.
  - Fixed the use case with ftrace instances.
]

Tzvetomir Stoyanov (VMware) (5):
  trace-cmd: Add new libtracefs API tracefs_instance_file_append()
  trace-cmd: Unit test for tracefs_instance_file_append() API
  trace-cmd: Add new libtraceevent flag to suppress parsing warnings
  trace-cmd: Suppress parsing warnings in tracefs_local_events() API
  trace-cmd: Add "--sql" option to trace-cmd start and record sub
    commands

 Documentation/trace-cmd-record.1.txt |   37 +
 Makefile                             |    1 +
 include/traceevent/event-parse.h     |    2 +
 include/tracefs/tracefs.h            |    2 +
 lib/traceevent/event-parse.c         |    6 +-
 lib/tracefs/tracefs-events.c         |    2 +-
 lib/tracefs/tracefs-instance.c       |   53 +-
 tracecmd/Makefile                    |   12 +-
 tracecmd/include/trace-local.h       |    4 +
 tracecmd/sqlparser/Makefile          |   52 +
 tracecmd/sqlparser/sqlhist-api.h     |   29 +
 tracecmd/sqlparser/sqlhist-parse.c   | 1526 ++++++++++++++++++++++++++
 tracecmd/sqlparser/sqlhist.h         |   34 +
 tracecmd/sqlparser/sqlhist.l         |   59 +
 tracecmd/sqlparser/sqlhist.y         |  175 +++
 tracecmd/trace-record.c              |  142 ++-
 tracecmd/trace-usage.c               |    2 +
 utest/tracefs-utest.c                |  106 +-
 18 files changed, 2202 insertions(+), 42 deletions(-)
 create mode 100644 tracecmd/sqlparser/Makefile
 create mode 100644 tracecmd/sqlparser/sqlhist-api.h
 create mode 100644 tracecmd/sqlparser/sqlhist-parse.c
 create mode 100644 tracecmd/sqlparser/sqlhist.h
 create mode 100644 tracecmd/sqlparser/sqlhist.l
 create mode 100644 tracecmd/sqlparser/sqlhist.y

-- 
2.24.1


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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 16:31 [PATCH v3 0/5] trace-cmd: SQL-like syntax for ftrace histograms configuration Tzvetomir Stoyanov (VMware)
2020-02-26 16:31 ` [PATCH v3 1/5] trace-cmd: Add new libtracefs API tracefs_instance_file_append() Tzvetomir Stoyanov (VMware)
2020-02-26 16:31 ` [PATCH v3 2/5] trace-cmd: Unit test for tracefs_instance_file_append() API Tzvetomir Stoyanov (VMware)
2020-02-26 16:31 ` [PATCH v3 3/5] trace-cmd: Add new libtraceevent flag to suppress parsing warnings Tzvetomir Stoyanov (VMware)
2020-02-26 16:31 ` [PATCH v3 4/5] trace-cmd: Suppress parsing warnings in tracefs_local_events() API Tzvetomir Stoyanov (VMware)
2020-02-26 16:31 ` [PATCH v3 5/5] trace-cmd: Add "--sql" option to trace-cmd start and record sub commands Tzvetomir Stoyanov (VMware)

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git