cursor = get_tls_callchain_cursor();
ret = sample__resolve_callchain(sample, cursor, NULL,
- evsel, &al, sysctl_perf_event_max_stack);
+ &al, sysctl_perf_event_max_stack);
if (ret)
goto out;
goto out;
/* this will parse DWARF using stack and register data */
- ret = thread__resolve_callchain(thread, cursor, evsel, sample,
+ ret = thread__resolve_callchain(thread, cursor, sample,
/*parent=*/NULL, /*root_al=*/NULL,
PERF_MAX_STACK_DEPTH);
thread__put(thread);
/*sample_in_dso=*/true);
}
- sample__for_each_callchain_node(thread, sample->evsel, sample, PERF_MAX_STACK_DEPTH,
+ sample__for_each_callchain_node(thread, sample, PERF_MAX_STACK_DEPTH,
/*symbols=*/false, mark_dso_hit_callback, &args);
thread__put(thread);
repipe:
* 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 = &kmem_session->machines.host;
if (cursor == NULL)
goto out;
- sample__resolve_callchain(sample, cursor, NULL, evsel, &al, 16);
+ sample__resolve_callchain(sample, cursor, /*parent=*/NULL, &al, 16);
callchain_cursor_commit(cursor);
while (true) {
if (parse_gfp_flags(evsel, sample, gfp_flags) < 0)
return -1;
- callsite = find_callsite(evsel, sample);
+ callsite = find_callsite(sample);
/*
* This is to find the current page (with correct gfp flags and
static void timehist_save_callchain(struct perf_kwork *kwork,
struct perf_sample *sample,
- struct evsel *evsel,
struct machine *machine)
{
struct symbol *sym;
cursor = get_tls_callchain_cursor();
- if (thread__resolve_callchain(thread, cursor, evsel, sample,
+ if (thread__resolve_callchain(thread, cursor, sample,
NULL, NULL, kwork->max_stack + 2) != 0) {
pr_debug("Failed to resolve callchain, skipping\n");
goto out_put;
return ret;
if (work != NULL)
- timehist_save_callchain(kwork, sample, evsel, machine);
+ timehist_save_callchain(kwork, sample, machine);
return 0;
}
return 0;
}
-static u64 callchain_id(struct evsel *evsel, struct perf_sample *sample);
+static u64 callchain_id(struct perf_sample *sample);
-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 == LOCK_AGGR_CALLER) {
- *key = callchain_id(evsel, sample);
+ *key = callchain_id(sample);
return 0;
}
return get_key_by_aggr_mode_simple(key, addr, sample->tid);
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;
cursor = get_tls_callchain_cursor();
/* use caller function name from the callchain */
- ret = thread__resolve_callchain(thread, cursor, evsel, sample,
+ ret = thread__resolve_callchain(thread, cursor, sample,
NULL, NULL, max_stack_depth);
if (ret != 0) {
thread__put(thread);
return -1;
}
-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 = &session->machines.host;
cursor = get_tls_callchain_cursor();
/* use caller function name from the callchain */
- ret = thread__resolve_callchain(thread, cursor, evsel, sample,
+ ret = thread__resolve_callchain(thread, cursor, sample,
NULL, NULL, max_stack_depth);
thread__put(thread);
return callstack;
}
-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;
struct map *kmap;
struct symbol *sym;
- ret = get_key_by_aggr_mode(&key, addr, evsel, sample);
+ ret = get_key_by_aggr_mode(&key, addr, sample);
if (ret < 0)
return ret;
break;
case LOCK_AGGR_CALLER:
name = buf;
- if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0)
+ if (lock_contention_caller(sample, buf, sizeof(buf)) < 0)
name = "Unknown";
break;
case LOCK_AGGR_CGROUP:
return 0;
}
-static int report_lock_contention_end_event(struct evsel *evsel,
+static int report_lock_contention_end_event(struct evsel *evsel __maybe_unused,
struct perf_sample *sample)
{
struct lock_stat *ls;
u64 key;
int ret;
- ret = get_key_by_aggr_mode(&key, addr, evsel, sample);
+ ret = get_key_by_aggr_mode(&key, addr, sample);
if (ret < 0)
return ret;
static void save_task_callchain(struct perf_sched *sched,
struct perf_sample *sample,
- struct evsel *evsel,
struct machine *machine)
{
struct callchain_cursor *cursor;
cursor = get_tls_callchain_cursor();
- if (thread__resolve_callchain(thread, cursor, evsel, sample,
+ if (thread__resolve_callchain(thread, cursor, sample,
NULL, NULL, sched->max_stack + 2) != 0) {
if (verbose > 0)
pr_err("Failed to resolve callchain. Skipping\n");
sample->tid);
}
- 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;
if (symbol_conf.use_callchain && sample->callchain) {
cursor = 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 = NULL;
if (symbol_conf.use_callchain && sample->callchain) {
cursor = 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 = NULL;
if (symbol_conf.use_callchain && sample->callchain) {
cursor = 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");
if (machine__resolve(trace->host, &al, sample) < 0)
goto out;
- err = thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack);
+ err = thread__resolve_callchain(al.thread, cursor, sample, NULL, NULL, max_stack);
out:
addr_location__exit(&al);
return err;
addr_location__exit(&al);
- sample__for_each_callchain_node(thread, sample->evsel, sample, PERF_MAX_STACK_DEPTH,
+ sample__for_each_callchain_node(thread, sample, PERF_MAX_STACK_DEPTH,
/*symbols=*/false, mark_dso_hit_callback, /*data=*/NULL);
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 == NULL && !symbol_conf.show_branchflag_count)
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;
return cycles;
}
-int sample__for_each_callchain_node(struct thread *thread, struct evsel *evsel,
+int sample__for_each_callchain_node(struct thread *thread,
struct perf_sample *sample, int max_stack,
bool symbols, callchain_iter_fn cb, void *data)
{
return -ENOMEM;
/* Fill in the callchain. */
- ret = __thread__resolve_callchain(thread, cursor, evsel, sample,
+ ret = __thread__resolve_callchain(thread, cursor, sample,
/*parent=*/NULL, /*root_al=*/NULL,
max_stack, symbols);
if (ret)
#include "branch.h"
struct addr_location;
-struct evsel;
struct hist_entry;
struct hists;
struct ip_callchain;
-struct map;
struct perf_sample;
struct record_opts;
struct thread;
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,
typedef int (*callchain_iter_fn)(struct callchain_cursor_node *node, void *data);
-int sample__for_each_callchain_node(struct thread *thread, struct evsel *evsel,
+int sample__for_each_callchain_node(struct thread *thread,
struct perf_sample *sample, int max_stack,
bool symbols, callchain_iter_fn cb, void *data);
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 = machine__kernel_start(machine);
struct call_path *current = &dbe->cpr->call_path;
*/
callchain_param.order = ORDER_CALLER;
cursor = get_tls_callchain_cursor();
- err = thread__resolve_callchain(thread, cursor, evsel,
+ err = thread__resolve_callchain(thread, cursor,
sample, NULL, NULL, PERF_MAX_STACK_DEPTH);
if (err) {
callchain_param.order = saved_order;
if (dbe->cpr) {
struct call_path *cp = call_path_from_sample(dbe, machine,
- thread, sample,
- evsel);
+ thread, sample);
if (cp) {
db_export__call_path(dbe, cp);
es.call_path_id = cp->db_id;
alm = map__get(al->map);
err = 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;
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 = sample->evsel;
struct branch_stack *branch = sample->branch_stack;
struct branch_entry *entries = perf_sample__branch_entries(sample);
struct ip_callchain *chain = sample->callchain;
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 = 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)))
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,
if (callchain_param.order == ORDER_CALLEE) {
ret = thread__resolve_callchain_sample(thread, cursor,
- evsel, sample,
+ sample,
parent, root_al,
max_stack, symbols);
if (ret)
return ret;
ret = thread__resolve_callchain_unwind(thread, cursor,
- evsel, sample,
+ sample,
max_stack, symbols);
} else {
ret = thread__resolve_callchain_unwind(thread, cursor,
- evsel, sample,
+ sample,
max_stack, symbols);
if (ret)
return ret;
ret = thread__resolve_callchain_sample(thread, cursor,
- evsel, sample,
+ sample,
parent, root_al,
max_stack, symbols);
}
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,
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,
{
return __thread__resolve_callchain(thread,
cursor,
- evsel,
sample,
parent,
root_al,
}
static SV *perl_process_callchain(struct perf_sample *sample,
- struct evsel *evsel,
+ struct evsel *evsel __maybe_unused,
struct addr_location *al)
{
struct callchain_cursor *cursor;
cursor = 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) != 0) {
pr_err("Failed to resolve callchain. Skipping\n");
goto exit;
}
static PyObject *python_process_callchain(struct perf_sample *sample,
- struct evsel *evsel,
+ struct evsel *evsel __maybe_unused,
struct addr_location *al)
{
PyObject *pylist;
goto exit;
cursor = 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) != 0) {
pr_err("Failed to resolve callchain. Skipping\n");