perf trace: Extract the comm/tid printing for syscall enter

Will be used with augmented syscalls, where we haven't transitioned
completely to combining sys_enter_FOO with sys_exit_FOO, so we'll go
as far as having it similar to the end result, strace like, as possible.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-canomaoiybkswwnhj69u9ae4@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1cdf618f
...@@ -1144,11 +1144,9 @@ static void sig_handler(int sig) ...@@ -1144,11 +1144,9 @@ static void sig_handler(int sig)
interrupted = sig == SIGINT; interrupted = sig == SIGINT;
} }
static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, static size_t trace__fprintf_comm_tid(struct trace *trace, struct thread *thread, FILE *fp)
u64 duration, bool duration_calculated, u64 tstamp, FILE *fp)
{ {
size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); size_t printed = 0;
printed += fprintf_duration(duration, duration_calculated, fp);
if (trace->multiple_threads) { if (trace->multiple_threads) {
if (trace->show_comm) if (trace->show_comm)
...@@ -1159,6 +1157,14 @@ static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thre ...@@ -1159,6 +1157,14 @@ static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thre
return printed; return printed;
} }
static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread,
u64 duration, bool duration_calculated, u64 tstamp, FILE *fp)
{
size_t printed = trace__fprintf_tstamp(trace, tstamp, fp);
printed += fprintf_duration(duration, duration_calculated, fp);
return printed + trace__fprintf_comm_tid(trace, thread, fp);
}
static int trace__process_event(struct trace *trace, struct machine *machine, static int trace__process_event(struct trace *trace, struct machine *machine,
union perf_event *event, struct perf_sample *sample) union perf_event *event, struct perf_sample *sample)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment