mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] adding of TGID to ftrace output
@ 2017-05-10 23:04 Joel Fernandes
  2017-05-11  1:28 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Fernandes @ 2017-05-10 23:04 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML

Hi Steven,

Can we add TGID information along with PID to ftrace output?

Something like:
#                                   _-----=> irqs-off
#                                  / _----=> need-resched
#                                 | / _---=> hardirq/softirq
#                                 || / _--=> preempt-depth
#                                 ||| /     delay
#           TASK-PID:TGID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |     |      |   ||||       |         |
            bash-1977:1977  [000] .... 17284.993652: sys_close <-

Instead of:
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
            bash-1977  [000] .... 17284.993652: sys_close <-

Currently in android, we inject tgid into each trace event at the end
of the trace just so we can group threads under a process in our trace
viewer.

The other option we're thinking off is we can retrieve tgid during the
trace output (reading trace file from debugfs/tracefs) from the
task_struct and then have ftrace output it that way.

Anyway, having this will really simplify things and make it more
reliable (we run ps -T at the end of the trace right now, but its
unreliable because threads might have exited by then). We also have to
call getpid() and inject pid into each userspace trace_marker write
just so we can do this grouping.

Regards,
Joel

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

end of thread, other threads:[~2017-05-11 18:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 23:04 [RFC] adding of TGID to ftrace output Joel Fernandes
2017-05-11  1:28 ` Steven Rostedt
2017-05-11  3:10   ` Joel Fernandes
2017-05-11 14:23     ` Steven Rostedt
2017-05-11 18:57       ` Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®