perf trace beauty: Export function to get the files for a thread

So that beautifiers can access things like dev_maj.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-wm5o51f206c5pi063dsaeraq@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 86cf4c65
...@@ -958,11 +958,6 @@ static size_t fprintf_duration(unsigned long t, bool calculated, FILE *fp) ...@@ -958,11 +958,6 @@ static size_t fprintf_duration(unsigned long t, bool calculated, FILE *fp)
return printed + fprintf(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.ptr: The filename char pointer that will be vfs_getname'd
* filename.entry_str_pos: Where to insert the string translated from * 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 f ...@@ -1064,6 +1059,11 @@ static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int f
return ttrace->files.table + fd; return 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) static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
{ {
struct thread_trace *ttrace = thread__priv(thread); struct thread_trace *ttrace = thread__priv(thread);
......
...@@ -32,6 +32,13 @@ size_t strarray__scnprintf_flags(struct strarray *sa, char *bf, size_t size, boo ...@@ -32,6 +32,13 @@ size_t strarray__scnprintf_flags(struct strarray *sa, char *bf, size_t size, boo
struct trace; struct trace;
struct thread; struct thread;
struct file {
char *pathname;
int dev_maj;
};
struct file *thread__files_entry(struct thread *thread, int fd);
struct strarrays { struct strarrays {
int nr_entries; int nr_entries;
struct strarray **entries; struct strarray **entries;
......
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