perf trace beauty: Export function to get the files for a thread
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 2d473389f87ace284bda35a5254bc66e24d0caa9 Gitweb: https://git.kernel.org/tip/2d473389f87ace284bda35a5254bc66e24d0caa9 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 27 Dec 2018 16:19:33 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 28 Dec 2018 16:33:05 -0300
perf trace beauty: Export function to get the files for a thread
So that beautifiers can access things like dev_maj.
Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Luis Cláudio Gonçalves <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-trace.c | 10 +++++----- tools/perf/trace/beauty/beauty.h | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-)
tools/perf/builtin-trace.c +5 -5
@@ -958,11 +958,6 @@ static size_t fprintf_duration(unsigned long t, bool calculated, FILE *fp)return printed +fprintf (fp,"): " ); } -struct file { -char *pathname; -int dev_maj; -}; -/** * filename.ptr: The filename char pointer that will be vfs_getname'd * filename.entry_str_pos: Where to insert the string translated from
@@ -1064,6 +1059,11 @@ static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int freturn ttrace->files.table + fd; } +struct file *thread__files_entry (struct thread *thread,int fd) +{ +return thread_trace__files_entry (thread__priv (thread), fd); +} +static int trace__set_fd_pathname (struct thread *thread,int fd,const char *pathname) {struct thread_trace *ttrace =thread__priv (thread);
tools/perf/trace/beauty/beauty.h +7 -0
@@ -32,6 +32,13 @@ size_t strarray__scnprintf_flags(struct strarray *sa, char *bf, size_t size, boostruct trace ;struct thread ; +struct file { +char *pathname; +int dev_maj; +}; + +struct file *thread__files_entry (struct thread *thread,int fd); +struct strarrays {int nr_entries;struct strarray **entries;