From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 01/15] perf map: Use map->dso->kernel + map__kmaps() in map__kmaps()
Date: Tue, 12 Nov 2019 15:37:43 -0300 [thread overview]
Message-ID: <20191112183757.28660-2-acme@kernel.org> (raw)
In-Reply-To: <20191112183757.28660-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Its equivalent to using map->groups to obtain the machine struct.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-bdbazuj4ggrmzxdviaqdrdwh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/map.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 466c9b035e19..a4d889c0fa88 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -244,18 +244,11 @@ struct map *map__new2(u64 start, struct dso *dso)
return map;
}
-/*
- * Use this and __map__is_kmodule() for map instances that are in
- * machine->kmaps, and thus have map->groups->machine all properly set, to
- * disambiguate between the kernel and modules.
- *
- * When the need arises, introduce map__is_{kernel,kmodule)() that
- * checks (map->groups != NULL && map->groups->machine != NULL &&
- * map->dso->kernel) before calling __map__is_{kernel,kmodule}())
- */
bool __map__is_kernel(const struct map *map)
{
- return machine__kernel_map(map->groups->machine) == map;
+ if (!map->dso->kernel)
+ return false;
+ return machine__kernel_map(map__kmaps((struct map *)map)->machine) == map;
}
bool __map__is_extra_kernel_map(const struct map *map)
--
2.21.0
next prev parent reply other threads:[~2019-11-12 18:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 18:37 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2019-11-12 18:37 ` Arnaldo Carvalho de Melo [this message]
2019-11-12 18:37 ` [PATCH 02/15] perf symbols: Stop using map->groups, we can use kmaps instead Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 03/15] perf map_groups: Pass the object to map_groups__find_ams() Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 04/15] perf tools: Add map_groups to 'struct addr_location' Arnaldo Carvalho de Melo
2019-11-29 13:40 ` Jiri Olsa
2019-11-29 15:17 ` Arnaldo Carvalho de Melo
2019-11-29 16:06 ` Arnaldo Carvalho de Melo
2019-11-29 18:03 ` Jiri Olsa
2019-11-29 18:59 ` Arnaldo Carvalho de Melo
2019-11-29 19:09 ` Jiri Olsa
2019-12-04 7:53 ` [tip: perf/urgent] perf machine: Fill map_symbol->maps in append_inlines() to fix segfault tip-bot2 for Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 05/15] perf annotate: Pass a 'map_symbol' in places receiving a pair of 'map' and 'symbol' pointers Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 06/15] perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 07/15] perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 08/15] pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 09/15] perf symbols: Use kmaps(map)->machine when we know its a kernel map Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 10/15] perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 11/15] perf annotate: Stop using map->groups, use map_symbol->mg instead Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 12/15] perf map: Combine maps__fixup_overlappings with its only use Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 13/15] perf map: Remove ->groups from 'struct map' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 14/15] perf tool: Provide an option to print perf_event_open args and return value Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 15/15] perf parse: Use YYABORT to clear stack after failure, plugging leaks Arnaldo Carvalho de Melo
2019-11-15 7:35 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191112183757.28660-2-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).