Skip to content

Commit 89dceb2

Browse files
namhyungacmel
authored andcommitted
perf trace: Use thread_{,_set}_priv helpers
This is mechanical changes only for accounting access to thread->priv properly in the source level. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 69e865c commit 89dceb2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/perf/builtin-trace.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,13 +1189,13 @@ static struct thread_trace *thread__trace(struct thread *thread, FILE *fp)
11891189
if (thread == NULL)
11901190
goto fail;
11911191

1192-
if (thread->priv == NULL)
1193-
thread->priv = thread_trace__new();
1192+
if (thread__priv(thread) == NULL)
1193+
thread__set_priv(thread, thread_trace__new());
11941194

1195-
if (thread->priv == NULL)
1195+
if (thread__priv(thread) == NULL)
11961196
goto fail;
11971197

1198-
ttrace = thread->priv;
1198+
ttrace = thread__priv(thread);
11991199
++ttrace->nr_events;
12001200

12011201
return ttrace;
@@ -1248,7 +1248,7 @@ struct trace {
12481248

12491249
static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
12501250
{
1251-
struct thread_trace *ttrace = thread->priv;
1251+
struct thread_trace *ttrace = thread__priv(thread);
12521252

12531253
if (fd > ttrace->paths.max) {
12541254
char **npath = realloc(ttrace->paths.table, (fd + 1) * sizeof(char *));
@@ -1301,7 +1301,7 @@ static int thread__read_fd_path(struct thread *thread, int fd)
13011301
static const char *thread__fd_path(struct thread *thread, int fd,
13021302
struct trace *trace)
13031303
{
1304-
struct thread_trace *ttrace = thread->priv;
1304+
struct thread_trace *ttrace = thread__priv(thread);
13051305

13061306
if (ttrace == NULL)
13071307
return NULL;
@@ -1338,7 +1338,7 @@ static size_t syscall_arg__scnprintf_close_fd(char *bf, size_t size,
13381338
{
13391339
int fd = arg->val;
13401340
size_t printed = syscall_arg__scnprintf_fd(bf, size, arg);
1341-
struct thread_trace *ttrace = arg->thread->priv;
1341+
struct thread_trace *ttrace = thread__priv(arg->thread);
13421342

13431343
if (ttrace && fd >= 0 && fd <= ttrace->paths.max)
13441344
zfree(&ttrace->paths.table[fd]);
@@ -2381,7 +2381,7 @@ static int trace__fprintf_one_thread(struct thread *thread, void *priv)
23812381
FILE *fp = data->fp;
23822382
size_t printed = data->printed;
23832383
struct trace *trace = data->trace;
2384-
struct thread_trace *ttrace = thread->priv;
2384+
struct thread_trace *ttrace = thread__priv(thread);
23852385
double ratio;
23862386

23872387
if (ttrace == NULL)

0 commit comments

Comments
 (0)