]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - tools/perf/trace/beauty/pid.c
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / tools / perf / trace / beauty / pid.c
CommitLineData
d1d438a3
ACM
1static size_t syscall_arg__scnprintf_pid(char *bf, size_t size, struct syscall_arg *arg)
2{
3 int pid = arg->val;
4 struct trace *trace = arg->trace;
5 size_t printed = scnprintf(bf, size, "%d", pid);
073e5fca 6 struct thread *thread = machine__findnew_thread(trace->host, pid, pid);
d1d438a3
ACM
7
8 if (thread != NULL) {
073e5fca
ACM
9 if (!thread->comm_set)
10 thread__set_comm_from_proc(thread);
11
d1d438a3
ACM
12 if (thread->comm_set)
13 printed += scnprintf(bf + printed, size - printed,
14 " (%s)", thread__comm_str(thread));
15 thread__put(thread);
16 }
17
18 return printed;
19}
20
21#define SCA_PID syscall_arg__scnprintf_pid