From nobody Tue Feb 10 15:43:47 2026 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12A9D38759B for ; Mon, 9 Feb 2026 17:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658861; cv=none; b=GBf3tvOMQDuajtuUxQgkkKNnKB2kQR3wP0LFco3s4H89BSMc6REm9zh0J6FvmFmuzxMCUUOV3bSqGUlYZhLTFsHvMHXu4JLpDjDMMIB2lMc9oCsrNnKmilLoHRzucb58J2eKvykYrFFAyCSv/mbxiUKrgsOVaJqOskJNYQ0iLVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658861; c=relaxed/simple; bh=Ymyf4OkMM5RVDYIBUBk0bNCltQLY0BkMBiINVudfrK8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=M4cN6cAUOdZaPkn4Z2TUm19Hgh9sQZdrQFGPHhN7coXeSywuCYUWAsA5mzkfM8QxOswhZ3cPKeXO3PFnVCqbAiwNy4b85bIuks6z0pHgprTjXg4y4MLvFyYrO7ecFHvkkWUkrzos1T1Nv4rpfcfLIpmpUJmqfzJsKTaUCt7GXbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ubvlhitG; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ubvlhitG" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2ba6ad2ca1fso8263266eec.1 for ; Mon, 09 Feb 2026 09:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770658860; x=1771263660; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=2eBADgCWoXh+qKXWbHhHuMbSLUqTo1brER8prOmQBbA=; b=ubvlhitGm13efQFzKCp/dgbLZNABzpPZd8GR2Sax9lnPd1/igZV6Fsf0ZtHDXNQBwB dp7QGcXfG5CYsywI05UjTs3LOafeaZW17zolw5ZWfBFVxq04kK7PZMpJBQmoJ9o5m+kr +s06xS8/NqAuebDuJQ/hBHJpaxxWNKsKkttoguKk+JUgtXySZr2ilyxVyS/h0/26HbPm vxltAZ0EiWq3kmVYzxzZ/KDoDLT5GBwjKkStmgecysyVP/Uu9aNSrMZr5JXEXSEIlf6u Fu+PuXOgI1MK+BewptK81vxekuNXAK+YOXz5+rpbjKT9wj1IbCxaDJpEj0hc9RB2I0Nl TDgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770658860; x=1771263660; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2eBADgCWoXh+qKXWbHhHuMbSLUqTo1brER8prOmQBbA=; b=SP8Sg+4AD8CZ1TGxL2toOVCZI+6/wXRF7prje41P6TbpyPG43ymtwrYIqtohz5kXct 1UpmOS3AvL/fp8RzSvi5LAz7vUolBL8SG5Bbggc7sN90xvHQhRSKrISxDHxiAmZqMH/S s+DxWein1yRP0y+NWrIp9bgEcJ4psn+H5HZRpTH5EbHWkfqqw1ycq/CXLwbezTxnGnZo 0crEFrReHx61vl/mnggCO65SD15WHFB/QyJfTPX67uPoCmClE2DCTD90U7IZx2flJ6L9 NtxoO5sWeL8x88yT9biOElSLa+ewVe3C5VLMv807WjQGpvTuLrYjOoDMMz2k5PM0ojru rl+Q== X-Forwarded-Encrypted: i=1; AJvYcCUTpHhhbUbnuuBrbLiD4y+aXrd/JaqP/kdASavconmIntgiVykDoDCPhJ7v+bouLQqwusEjujaN5GT+3pI=@vger.kernel.org X-Gm-Message-State: AOJu0YyZ4yOvzPQ9xyeoZcaqPGuPZZTOjx34jum+ikDTAUIe2VilOyhN E51UAm+iNB9Wko/GkNdbekWsy6SVo8Equ5SZETYoNFi2h/dk9ezovFv0BEgpTGHbkhWkfX4DJaS 0BKxBmWUoqg== X-Received: from dycma8.prod.google.com ([2002:a05:693c:2288:b0:2b7:994c:cd4c]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:572c:b0:2b8:2946:72c5 with SMTP id 5a478bee46e88-2b856a40ddfmr5623598eec.39.1770658860036; Mon, 09 Feb 2026 09:41:00 -0800 (PST) Date: Mon, 9 Feb 2026 09:40:15 -0800 In-Reply-To: <20260209174032.4142096-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260209174032.4142096-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.239.g8d8fc8a987-goog Message-ID: <20260209174032.4142096-9-irogers@google.com> Subject: [PATCH v1 08/25] perf callchain: Don't pass evsel and sample From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Leo Yan , Tianyou Li , Athira Rajeev , Derek Foreman , Thomas Falcon , Howard Chu , Dmitry Vyukov , Andi Kleen , tanze , Hrishikesh Suresh , Quan Zhou , Andrew Jones , Anup Patel , Dapeng Mi , "Dr. David Alan Gilbert" , "=?UTF-8?q?Krzysztof=20=C5=81opatowski?=" , Chun-Tse Shao , Ravi Bangoria , Swapnil Sapkal , Chen Ni , Blake Jones , Yujie Liu , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Change callchain resolve code to not pass an evsel with the sample, instead just read the evsel from the sample. Signed-off-by: Ian Rogers --- tools/perf/builtin-c2c.c | 2 +- tools/perf/builtin-inject.c | 4 ++-- tools/perf/builtin-kmem.c | 6 ++--- tools/perf/builtin-kwork.c | 5 ++-- tools/perf/builtin-lock.c | 24 +++++++++---------- tools/perf/builtin-sched.c | 5 ++-- tools/perf/builtin-script.c | 6 ++--- tools/perf/builtin-trace.c | 2 +- tools/perf/util/build-id.c | 2 +- tools/perf/util/callchain.c | 8 +++---- tools/perf/util/callchain.h | 5 ++-- tools/perf/util/db-export.c | 8 +++---- tools/perf/util/hist.c | 2 +- tools/perf/util/machine.c | 14 +++++------ tools/perf/util/machine.h | 3 --- .../util/scripting-engines/trace-event-perl.c | 2 +- .../scripting-engines/trace-event-python.c | 2 +- 17 files changed, 46 insertions(+), 54 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 89456ba6fcbb..f9ac871264af 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -339,7 +339,7 @@ static int process_sample_event(const struct perf_tool = *tool __maybe_unused, =20 cursor =3D get_tls_callchain_cursor(); ret =3D sample__resolve_callchain(sample, cursor, NULL, - evsel, &al, sysctl_perf_event_max_stack); + &al, sysctl_perf_event_max_stack); if (ret) goto out; =20 diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 3226ab326315..016ad84ac4ab 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -418,7 +418,7 @@ static int perf_event__convert_sample_callchain(const s= truct perf_tool *tool, goto out; =20 /* this will parse DWARF using stack and register data */ - ret =3D thread__resolve_callchain(thread, cursor, evsel, sample, + ret =3D thread__resolve_callchain(thread, cursor, sample, /*parent=3D*/NULL, /*root_al=3D*/NULL, PERF_MAX_STACK_DEPTH); thread__put(thread); @@ -1020,7 +1020,7 @@ static int perf_event__inject_buildid(const struct pe= rf_tool *tool, union perf_e } =20 sample->evsel =3D inject__mmap_evsel(inject); - sample__for_each_callchain_node(thread, sample->evsel, sample, PERF_MAX_S= TACK_DEPTH, + sample__for_each_callchain_node(thread, sample, PERF_MAX_STACK_DEPTH, /*symbols=3D*/false, mark_dso_hit_callback, &args); sample->evsel =3D saved_evsel; thread__put(thread); diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 96b78a64c1c1..19b12209fc08 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -394,7 +394,7 @@ static int build_alloc_func_list(void) * Find first non-memory allocation function from callchain. * The allocation functions are in the 'alloc_func_list'. */ -static u64 find_callsite(struct evsel *evsel, struct perf_sample *sample) +static u64 find_callsite(struct perf_sample *sample) { struct addr_location al; struct machine *machine =3D &kmem_session->machines.host; @@ -414,7 +414,7 @@ static u64 find_callsite(struct evsel *evsel, struct pe= rf_sample *sample) if (cursor =3D=3D NULL) goto out; =20 - sample__resolve_callchain(sample, cursor, NULL, evsel, &al, 16); + sample__resolve_callchain(sample, cursor, /*parent=3D*/NULL, &al, 16); =20 callchain_cursor_commit(cursor); while (true) { @@ -839,7 +839,7 @@ static int evsel__process_page_alloc_event(struct evsel= *evsel, struct perf_samp if (parse_gfp_flags(evsel, sample, gfp_flags) < 0) return -1; =20 - callsite =3D find_callsite(evsel, sample); + callsite =3D find_callsite(sample); =20 /* * This is to find the current page (with correct gfp flags and diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index f47b54a68726..bd62616af476 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -688,7 +688,6 @@ static int latency_entry_event(struct perf_kwork *kwork, =20 static void timehist_save_callchain(struct perf_kwork *kwork, struct perf_sample *sample, - struct evsel *evsel, struct machine *machine) { struct symbol *sym; @@ -708,7 +707,7 @@ static void timehist_save_callchain(struct perf_kwork *= kwork, =20 cursor =3D get_tls_callchain_cursor(); =20 - if (thread__resolve_callchain(thread, cursor, evsel, sample, + if (thread__resolve_callchain(thread, cursor, sample, NULL, NULL, kwork->max_stack + 2) !=3D 0) { pr_debug("Failed to resolve callchain, skipping\n"); goto out_put; @@ -838,7 +837,7 @@ static int timehist_entry_event(struct perf_kwork *kwor= k, return ret; =20 if (work !=3D NULL) - timehist_save_callchain(kwork, sample, evsel, machine); + timehist_save_callchain(kwork, sample, machine); =20 return 0; } diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index baf0c99df5df..a35e8ea4e2ef 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -551,13 +551,13 @@ static int get_key_by_aggr_mode_simple(u64 *key, u64 = addr, u32 tid) return 0; } =20 -static u64 callchain_id(struct evsel *evsel, struct perf_sample *sample); +static u64 callchain_id(struct perf_sample *sample); =20 -static int get_key_by_aggr_mode(u64 *key, u64 addr, struct evsel *evsel, +static int get_key_by_aggr_mode(u64 *key, u64 addr, struct perf_sample *sample) { if (aggr_mode =3D=3D LOCK_AGGR_CALLER) { - *key =3D callchain_id(evsel, sample); + *key =3D callchain_id(sample); return 0; } return get_key_by_aggr_mode_simple(key, addr, sample->tid); @@ -841,7 +841,7 @@ static int get_symbol_name_offset(struct map *map, stru= ct symbol *sym, u64 ip, else return strlcpy(buf, sym->name, size); } -static int lock_contention_caller(struct evsel *evsel, struct perf_sample = *sample, +static int lock_contention_caller(struct perf_sample *sample, char *buf, int size) { struct thread *thread; @@ -862,7 +862,7 @@ static int lock_contention_caller(struct evsel *evsel, = struct perf_sample *sampl cursor =3D get_tls_callchain_cursor(); =20 /* use caller function name from the callchain */ - ret =3D thread__resolve_callchain(thread, cursor, evsel, sample, + ret =3D thread__resolve_callchain(thread, cursor, sample, NULL, NULL, max_stack_depth); if (ret !=3D 0) { thread__put(thread); @@ -896,7 +896,7 @@ static int lock_contention_caller(struct evsel *evsel, = struct perf_sample *sampl return -1; } =20 -static u64 callchain_id(struct evsel *evsel, struct perf_sample *sample) +static u64 callchain_id(struct perf_sample *sample) { struct callchain_cursor *cursor; struct machine *machine =3D &session->machines.host; @@ -911,7 +911,7 @@ static u64 callchain_id(struct evsel *evsel, struct per= f_sample *sample) =20 cursor =3D get_tls_callchain_cursor(); /* use caller function name from the callchain */ - ret =3D thread__resolve_callchain(thread, cursor, evsel, sample, + ret =3D thread__resolve_callchain(thread, cursor, sample, NULL, NULL, max_stack_depth); thread__put(thread); =20 @@ -963,7 +963,7 @@ static u64 *get_callstack(struct perf_sample *sample, i= nt max_stack) return callstack; } =20 -static int report_lock_contention_begin_event(struct evsel *evsel, +static int report_lock_contention_begin_event(struct evsel *evsel __maybe_= unused, struct perf_sample *sample) { struct lock_stat *ls; @@ -978,7 +978,7 @@ static int report_lock_contention_begin_event(struct ev= sel *evsel, struct map *kmap; struct symbol *sym; =20 - ret =3D get_key_by_aggr_mode(&key, addr, evsel, sample); + ret =3D get_key_by_aggr_mode(&key, addr, sample); if (ret < 0) return ret; =20 @@ -1025,7 +1025,7 @@ static int report_lock_contention_begin_event(struct = evsel *evsel, break; case LOCK_AGGR_CALLER: name =3D buf; - if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0) + if (lock_contention_caller(sample, buf, sizeof(buf)) < 0) name =3D "Unknown"; break; case LOCK_AGGR_CGROUP: @@ -1127,7 +1127,7 @@ static int report_lock_contention_begin_event(struct = evsel *evsel, return 0; } =20 -static int report_lock_contention_end_event(struct evsel *evsel, +static int report_lock_contention_end_event(struct evsel *evsel __maybe_un= used, struct perf_sample *sample) { struct lock_stat *ls; @@ -1138,7 +1138,7 @@ static int report_lock_contention_end_event(struct ev= sel *evsel, u64 key; int ret; =20 - ret =3D get_key_by_aggr_mode(&key, addr, evsel, sample); + ret =3D get_key_by_aggr_mode(&key, addr, sample); if (ret < 0) return ret; =20 diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index c2bf187104b2..0580dc20720f 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -2325,7 +2325,6 @@ static bool is_idle_sample(struct perf_sample *sample, =20 static void save_task_callchain(struct perf_sched *sched, struct perf_sample *sample, - struct evsel *evsel, struct machine *machine) { struct callchain_cursor *cursor; @@ -2345,7 +2344,7 @@ static void save_task_callchain(struct perf_sched *sc= hed, =20 cursor =3D get_tls_callchain_cursor(); =20 - if (thread__resolve_callchain(thread, cursor, evsel, sample, + if (thread__resolve_callchain(thread, cursor, sample, NULL, NULL, sched->max_stack + 2) !=3D 0) { if (verbose > 0) pr_err("Failed to resolve callchain. Skipping\n"); @@ -2519,7 +2518,7 @@ static struct thread *timehist_get_thread(struct perf= _sched *sched, sample->tid); } =20 - save_task_callchain(sched, sample, evsel, machine); + save_task_callchain(sched, sample, machine); if (sched->idle_hist) { struct thread *idle; struct idle_thread_runtime *itr; diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 28fe3ff02cf5..7788a6934a8d 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1679,7 +1679,7 @@ static int perf_sample__fprintf_bts(struct perf_sampl= e *sample, =20 if (symbol_conf.use_callchain && sample->callchain) { cursor =3D get_tls_callchain_cursor(); - if (thread__resolve_callchain(al->thread, cursor, evsel, + if (thread__resolve_callchain(al->thread, cursor, sample, NULL, NULL, scripting_max_stack)) cursor =3D NULL; @@ -2502,7 +2502,7 @@ static void process_event(struct perf_script *script, =20 if (symbol_conf.use_callchain && sample->callchain) { cursor =3D get_tls_callchain_cursor(); - if (thread__resolve_callchain(al->thread, cursor, evsel, + if (thread__resolve_callchain(al->thread, cursor, sample, NULL, NULL, scripting_max_stack)) cursor =3D NULL; @@ -2786,7 +2786,7 @@ static int process_deferred_sample_event(const struct= perf_tool *tool, =20 if (symbol_conf.use_callchain && sample->callchain) { cursor =3D get_tls_callchain_cursor(); - if (thread__resolve_callchain(al.thread, cursor, evsel, + if (thread__resolve_callchain(al.thread, cursor, sample, NULL, NULL, scripting_max_stack)) { pr_info("cannot resolve deferred callchains\n"); diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 7a0913595943..b6e90ee53cbe 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2904,7 +2904,7 @@ static int trace__resolve_callchain(struct trace *tra= ce, if (machine__resolve(trace->host, &al, sample) < 0) goto out; =20 - err =3D thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL,= NULL, max_stack); + err =3D thread__resolve_callchain(al.thread, cursor, sample, NULL, NULL, = max_stack); out: addr_location__exit(&al); return err; diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 55b72235f891..af4d874f1381 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -73,7 +73,7 @@ int build_id__mark_dso_hit(const struct perf_tool *tool _= _maybe_unused, =20 addr_location__exit(&al); =20 - sample__for_each_callchain_node(thread, sample->evsel, sample, PERF_MAX_S= TACK_DEPTH, + sample__for_each_callchain_node(thread, sample, PERF_MAX_STACK_DEPTH, /*symbols=3D*/false, mark_dso_hit_callback, /*data=3D*/NULL); =20 =20 diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 8ff0898799ee..4f485ed046a4 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -1123,7 +1123,7 @@ int callchain_cursor_append(struct callchain_cursor *= cursor, =20 int sample__resolve_callchain(struct perf_sample *sample, struct callchain_cursor *cursor, struct symbol **parent, - struct evsel *evsel, struct addr_location *al, + struct addr_location *al, int max_stack) { if (sample->callchain =3D=3D NULL && !symbol_conf.show_branchflag_count) @@ -1131,7 +1131,7 @@ int sample__resolve_callchain(struct perf_sample *sam= ple, =20 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain || perf_hpp_list.parent || symbol_conf.show_branchflag_count) { - return thread__resolve_callchain(al->thread, cursor, evsel, sample, + return thread__resolve_callchain(al->thread, cursor, sample, parent, al, max_stack); } return 0; @@ -1806,7 +1806,7 @@ s64 callchain_avg_cycles(struct callchain_node *cnode) return cycles; } =20 -int sample__for_each_callchain_node(struct thread *thread, struct evsel *e= vsel, +int sample__for_each_callchain_node(struct thread *thread, struct perf_sample *sample, int max_stack, bool symbols, callchain_iter_fn cb, void *data) { @@ -1817,7 +1817,7 @@ int sample__for_each_callchain_node(struct thread *th= read, struct evsel *evsel, return -ENOMEM; =20 /* Fill in the callchain. */ - ret =3D __thread__resolve_callchain(thread, cursor, evsel, sample, + ret =3D __thread__resolve_callchain(thread, cursor, sample, /*parent=3D*/NULL, /*root_al=3D*/NULL, max_stack, symbols); if (ret) diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index df54ddb8c0cb..6eb3e20349a9 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -8,7 +8,6 @@ #include "branch.h" =20 struct addr_location; -struct evsel; struct ip_callchain; struct map; struct perf_sample; @@ -251,7 +250,7 @@ int record_opts__parse_callchain(struct record_opts *re= cord, =20 int sample__resolve_callchain(struct perf_sample *sample, struct callchain_cursor *cursor, struct symbol **parent, - struct evsel *evsel, struct addr_location *al, + struct addr_location *al, int max_stack); int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample= *sample); int fill_callchain_info(struct addr_location *al, struct callchain_cursor_= node *node, @@ -314,7 +313,7 @@ s64 callchain_avg_cycles(struct callchain_node *cnode); =20 typedef int (*callchain_iter_fn)(struct callchain_cursor_node *node, void = *data); =20 -int sample__for_each_callchain_node(struct thread *thread, struct evsel *e= vsel, +int sample__for_each_callchain_node(struct thread *thread, struct perf_sample *sample, int max_stack, bool symbols, callchain_iter_fn cb, void *data); =20 diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index ae9a9065aab7..a1f578c3a8d5 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -209,8 +209,7 @@ static int db_ids_from_al(struct db_export *dbe, struct= addr_location *al, static struct call_path *call_path_from_sample(struct db_export *dbe, struct machine *machine, struct thread *thread, - struct perf_sample *sample, - struct evsel *evsel) + struct perf_sample *sample) { u64 kernel_start =3D machine__kernel_start(machine); struct call_path *current =3D &dbe->cpr->call_path; @@ -228,7 +227,7 @@ static struct call_path *call_path_from_sample(struct d= b_export *dbe, */ callchain_param.order =3D ORDER_CALLER; cursor =3D get_tls_callchain_cursor(); - err =3D thread__resolve_callchain(thread, cursor, evsel, + err =3D thread__resolve_callchain(thread, cursor, sample, NULL, NULL, PERF_MAX_STACK_DEPTH); if (err) { callchain_param.order =3D saved_order; @@ -391,8 +390,7 @@ int db_export__sample(struct db_export *dbe, union perf= _event *event, =20 if (dbe->cpr) { struct call_path *cp =3D call_path_from_sample(dbe, machine, - thread, sample, - evsel); + thread, sample); if (cp) { db_export__call_path(dbe, cp); es.call_path_id =3D cp->db_id; diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 7ffaa3d9851b..84a402d248a3 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1339,7 +1339,7 @@ int hist_entry_iter__add(struct hist_entry_iter *iter= , struct addr_location *al, alm =3D map__get(al->map); =20 err =3D sample__resolve_callchain(iter->sample, get_tls_callchain_cursor(= ), &iter->parent, - iter->evsel, al, max_stack_depth); + al, max_stack_depth); if (err) { map__put(alm); return err; diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index e76f8c86e62a..c2e0a99efe97 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2778,13 +2778,13 @@ static u64 get_leaf_frame_caller(struct perf_sample= *sample, =20 static int thread__resolve_callchain_sample(struct thread *thread, struct callchain_cursor *cursor, - struct evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, int max_stack, bool symbols) { + struct evsel *evsel =3D sample->evsel; struct branch_stack *branch =3D sample->branch_stack; struct branch_entry *entries =3D perf_sample__branch_entries(sample); struct ip_callchain *chain =3D sample->callchain; @@ -2986,10 +2986,11 @@ static int unwind_entry(struct unwind_entry *entry,= void *arg) =20 static int thread__resolve_callchain_unwind(struct thread *thread, struct callchain_cursor *cursor, - struct evsel *evsel, struct perf_sample *sample, int max_stack, bool symbols) { + struct evsel *evsel =3D sample->evsel; + /* Can we do dwarf post unwind? */ if (!((evsel->core.attr.sample_type & PERF_SAMPLE_REGS_USER) && (evsel->core.attr.sample_type & PERF_SAMPLE_STACK_USER))) @@ -3009,7 +3010,6 @@ static int thread__resolve_callchain_unwind(struct th= read *thread, =20 int __thread__resolve_callchain(struct thread *thread, struct callchain_cursor *cursor, - struct evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, @@ -3025,22 +3025,22 @@ int __thread__resolve_callchain(struct thread *thre= ad, =20 if (callchain_param.order =3D=3D ORDER_CALLEE) { ret =3D thread__resolve_callchain_sample(thread, cursor, - evsel, sample, + sample, parent, root_al, max_stack, symbols); if (ret) return ret; ret =3D thread__resolve_callchain_unwind(thread, cursor, - evsel, sample, + sample, max_stack, symbols); } else { ret =3D thread__resolve_callchain_unwind(thread, cursor, - evsel, sample, + sample, max_stack, symbols); if (ret) return ret; ret =3D thread__resolve_callchain_sample(thread, cursor, - evsel, sample, + sample, parent, root_al, max_stack, symbols); } diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 22a42c5825fa..048b24e9bd38 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h @@ -187,7 +187,6 @@ struct callchain_cursor; =20 int __thread__resolve_callchain(struct thread *thread, struct callchain_cursor *cursor, - struct evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, @@ -196,7 +195,6 @@ int __thread__resolve_callchain(struct thread *thread, =20 static inline int thread__resolve_callchain(struct thread *thread, struct callchain_cursor *cursor, - struct evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, @@ -204,7 +202,6 @@ static inline int thread__resolve_callchain(struct thre= ad *thread, { return __thread__resolve_callchain(thread, cursor, - evsel, sample, parent, root_al, diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/p= erf/util/scripting-engines/trace-event-perl.c index e261a57b87d4..850a0048df82 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -272,7 +272,7 @@ static SV *perl_process_callchain(struct perf_sample *s= ample, =20 cursor =3D get_tls_callchain_cursor(); =20 - if (thread__resolve_callchain(al->thread, cursor, evsel, + if (thread__resolve_callchain(al->thread, cursor, sample, NULL, NULL, scripting_max_stack) !=3D 0) { pr_err("Failed to resolve callchain. Skipping\n"); goto exit; diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools= /perf/util/scripting-engines/trace-event-python.c index 2b0df7bd9a46..0d8665c75d30 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -404,7 +404,7 @@ static PyObject *python_process_callchain(struct perf_s= ample *sample, goto exit; =20 cursor =3D get_tls_callchain_cursor(); - if (thread__resolve_callchain(al->thread, cursor, evsel, + if (thread__resolve_callchain(al->thread, cursor, sample, NULL, NULL, scripting_max_stack) !=3D 0) { pr_err("Failed to resolve callchain. Skipping\n"); --=20 2.53.0.239.g8d8fc8a987-goog