lkml.org 
[lkml]   [2020]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] perf inject: Do not load map/dso when injecting build-id
On Wed, Sep 23, 2020 at 05:05:34PM +0900, Namhyung Kim wrote:

SNIP

> -static inline int is_no_dso_memory(const char *filename)
> -{
> - return !strncmp(filename, "[stack", 6) ||
> - !strncmp(filename, "/SYSV",5) ||
> - !strcmp(filename, "[heap]");
> -}
> -
> static inline int is_android_lib(const char *filename)
> {
> return strstarts(filename, "/data/app-lib/") ||
> @@ -158,7 +143,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
> int anon, no_dso, vdso, android;
>
> android = is_android_lib(filename);
> - anon = is_anon_memory(filename, flags);
> + anon = is_anon_memory(filename) || flags & MAP_HUGETLB;

what's the reason to take 'flags & MAP_HUGETLB' out of is_anon_memory?

jirka

> vdso = is_vdso_map(filename);
> no_dso = is_no_dso_memory(filename);
> map->prot = prot;
> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
> index c2f5d28fe73a..b1c0686db1b7 100644
> --- a/tools/perf/util/map.h
> +++ b/tools/perf/util/map.h
> @@ -171,4 +171,18 @@ static inline bool is_bpf_image(const char *name)
> return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) == 0 ||
> strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1) == 0;
> }
> +
> +static inline int is_anon_memory(const char *filename)
> +{
> + return !strcmp(filename, "//anon") ||
> + !strncmp(filename, "/dev/zero", sizeof("/dev/zero") - 1) ||
> + !strncmp(filename, "/anon_hugepage", sizeof("/anon_hugepage") - 1);
> +}
> +
> +static inline int is_no_dso_memory(const char *filename)
> +{
> + return !strncmp(filename, "[stack", 6) ||
> + !strncmp(filename, "/SYSV", 5) ||
> + !strcmp(filename, "[heap]");
> +}
> #endif /* __PERF_MAP_H */
> --
> 2.28.0.681.g6f77f65b4e-goog
>

\
 
 \ /
  Last update: 2020-09-24 15:10    [W:0.127 / U:3.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site