Re: [PATCH 0/6] libtracefs: Fixes for sqlhist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 2022-06-06 at 15:29 -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
> 
> At Kernel Recipes, I demonstrated sqlhist and how to use it. Along the way,
> I discovered several bugs. This series addresses those bugs that were found.

For the whole series:

Tested-by: Harald Seiler <hws@xxxxxxx>

As a sanity check I accumulated offcpu time for a process:

	sqlhist -e -n 'offcpu' 'SELECT start.prev_comm AS comm, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) as lat FROM sched_switch as start JOIN sched_switch as end ON start.prev_pid == end.next_pid WHERE start.prev_comm == "ping"'
	echo "hist:keys=comm:vals=lat:sort=lat" >/sys/kernel/tracing/events/synthetic/offcpu/trigger

And then verified the collected time is consistent by comparing with
getrusage(2) values for the process (as returned by time(1)).

And indeed,

	wall_time == ru_utime + ru_stime + lat

So it is measuring exactly what I want.

Thanks again for getting this working!

> Steven Rostedt (Google) (6):
>   libtracefs: Fix make sqlhist when built again
>   libtracefs: Add libtracefs.a to dependency of sqlhist
>   libtracefs: Differentiate FROM and JOIN events if they are the same
>     event
>   libtracefs: Use unique names for sql field variables
>   libtracefs: Differentiate WHERE clause when FROM and TO events are the
>     same
>   libtracefs sqlhist: Report errors executing the commands
> 
>  Documentation/libtracefs-sql.txt |  18 ++++--
>  include/tracefs-local.h          |   4 ++
>  samples/Makefile                 |   4 +-
>  src/sqlhist-parse.h              |   3 +-
>  src/tracefs-hist.c               | 105 ++++++++++++++++++++++++++++---
>  src/tracefs-sqlhist.c            |  44 +++++++++----
>  6 files changed, 150 insertions(+), 28 deletions(-)
> 

-- 
Harald



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux