perf map: Use map->prot in place of type==MAP__FUNCTION
Equivalent, one step more in ditching enum map_type. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-mrjjc87a4tpf896j5u4sql4e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -173,7 +173,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
|
|||||||
map->flags = flags;
|
map->flags = flags;
|
||||||
nsi = nsinfo__get(thread->nsinfo);
|
nsi = nsinfo__get(thread->nsinfo);
|
||||||
|
|
||||||
if ((anon || no_dso) && nsi && type == MAP__FUNCTION) {
|
if ((anon || no_dso) && nsi && (prot & PROT_EXEC)) {
|
||||||
snprintf(newfilename, sizeof(newfilename),
|
snprintf(newfilename, sizeof(newfilename),
|
||||||
"/tmp/perf-%d.map", nsi->pid);
|
"/tmp/perf-%d.map", nsi->pid);
|
||||||
filename = newfilename;
|
filename = newfilename;
|
||||||
@@ -213,7 +213,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
|
|||||||
* functions still return NULL, and we avoid the
|
* functions still return NULL, and we avoid the
|
||||||
* unnecessary map__load warning.
|
* unnecessary map__load warning.
|
||||||
*/
|
*/
|
||||||
if (type != MAP__FUNCTION)
|
if (!(prot & PROT_EXEC))
|
||||||
dso__set_loaded(dso, map->type);
|
dso__set_loaded(dso, map->type);
|
||||||
}
|
}
|
||||||
dso->nsinfo = nsi;
|
dso->nsinfo = nsi;
|
||||||
|
|||||||
Reference in New Issue
Block a user