diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-12-20 19:43:36 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-01-08 13:28:13 -0300 |
commit | 011532379b7c2de6757e129037bdfc8d704bce23 (patch) | |
tree | e678e3805c2bcd159b788730b8ce415ebdf0703b /tools/perf/util/find-vdso-map.c | |
parent | ac6e022cbfdce215ad545e91d9827060855da3d7 (diff) | |
download | blackbird-obmc-linux-011532379b7c2de6757e129037bdfc8d704bce23.tar.gz blackbird-obmc-linux-011532379b7c2de6757e129037bdfc8d704bce23.zip |
perf tools: Make find_vdso_map() more modular
In preparation for checking that the vectors page on the ARM
architecture, refactor the find_vdso_map() function to accept finding an
arbitrary string and create a dedicated helper function for that under
util/find-map.c and update the filename to find-map.c and all references
to it: perf-read-vdso.c and util/vdso.c.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: http://lkml.kernel.org/r/20181221034337.26663-2-f.fainelli@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/find-vdso-map.c')
-rw-r--r-- | tools/perf/util/find-vdso-map.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/perf/util/find-vdso-map.c b/tools/perf/util/find-vdso-map.c deleted file mode 100644 index d7823e3508fc..000000000000 --- a/tools/perf/util/find-vdso-map.c +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -static int find_vdso_map(void **start, void **end) -{ - FILE *maps; - char line[128]; - int found = 0; - - maps = fopen("/proc/self/maps", "r"); - if (!maps) { - fprintf(stderr, "vdso: cannot open maps\n"); - return -1; - } - - while (!found && fgets(line, sizeof(line), maps)) { - int m = -1; - - /* We care only about private r-x mappings. */ - if (2 != sscanf(line, "%p-%p r-xp %*x %*x:%*x %*u %n", - start, end, &m)) - continue; - if (m < 0) - continue; - - if (!strncmp(&line[m], VDSO__MAP_NAME, - sizeof(VDSO__MAP_NAME) - 1)) - found = 1; - } - - fclose(maps); - return !found; -} |