summaryrefslogtreecommitdiff
path: root/tools/perf/util/machine.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-12-06 13:49:04 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-12-14 11:16:12 -0300
commitcc2367eebb0c3c5501cddd5823e5feda7b57f706 (patch)
tree7f6ed91dbbcceb75f5f2793d55f41db7a2d0b5d4 /tools/perf/util/machine.h
parent9d9b22bedad13d96b34fe005ef44b4523c4eb786 (diff)
downloadlwn-cc2367eebb0c3c5501cddd5823e5feda7b57f706.tar.gz
lwn-cc2367eebb0c3c5501cddd5823e5feda7b57f706.zip
machine: Adopt is_lock_function() from builtin-lock.c
It is used in bpf_lock_contention.c and builtin-lock.c will be made CONFIG_LIBTRACEEVENT=y conditional, so move it to machine.c, that is always available. This makes those 4 global variables for sched and lock text start and end to move to 'struct machine' too, as conceivably we can have that info for several machine instances, say some 'perf diff' like tool. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/machine.h')
-rw-r--r--tools/perf/util/machine.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 6267c1d6f232..d034ecaf89c1 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -56,6 +56,10 @@ struct machine {
struct maps *kmaps;
struct map *vmlinux_map;
u64 kernel_start;
+ struct {
+ u64 text_start;
+ u64 text_end;
+ } sched, lock;
pid_t *current_tid;
size_t current_tid_sz;
union { /* Tool specific area */
@@ -212,6 +216,7 @@ static inline bool machine__is_host(struct machine *machine)
return machine ? machine->pid == HOST_KERNEL_ID : false;
}
+bool machine__is_lock_function(struct machine *machine, u64 addr);
bool machine__is(struct machine *machine, const char *arch);
bool machine__normalized_is(struct machine *machine, const char *arch);
int machine__nr_cpus_avail(struct machine *machine);