lkml.org 
[lkml]   [2022]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 5/7] perf kwork: Strdup function name in workqueue_work_init
Date
perf_session has been deleted when report, maps data in session has been free,
we need to copy duplicate of workqueue function symbol for future use.

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
tools/perf/builtin-kwork.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
index d6c09044a929..33bcab2aafcd 100644
--- a/tools/perf/builtin-kwork.c
+++ b/tools/perf/builtin-kwork.c
@@ -1021,7 +1021,7 @@ static void workqueue_work_init(struct kwork_class *class,
work->cpu = sample->cpu;
work->id = evsel__intval(evsel, sample, "work");
work->name = function_addr == 0 ? NULL :
- machine__resolve_kernel_addr(machine, &function_addr, &modp);
+ strdup(machine__resolve_kernel_addr(machine, &function_addr, &modp));
}

static void workqueue_work_name(struct kwork_work *work, char *buf, int len)
--
2.30.GIT
\
 
 \ /
  Last update: 2022-07-30 05:07    [W:0.084 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site