lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-919d1k13ts62pjipnpibvgwd@git.kernel.org>
Date:   Wed, 2 May 2018 10:55:30 -0700
From:   tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     wangnan0@...wei.com, hpa@...or.com, tglx@...utronix.de,
        namhyung@...nel.org, dsahern@...il.com,
        linux-kernel@...r.kernel.org, adrian.hunter@...el.com,
        acme@...hat.com, mingo@...nel.org, jolsa@...nel.org
Subject: [tip:perf/core] perf symbols: Remove map_type arg from
 dso__find_symbol()

Commit-ID:  af07eeb04ca9c992b67a59aa8bc10118b610d518
Gitweb:     https://git.kernel.org/tip/af07eeb04ca9c992b67a59aa8bc10118b610d518
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 25 Apr 2018 17:46:28 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 26 Apr 2018 13:47:15 -0300

perf symbols: Remove map_type arg from dso__find_symbol()

One more step to ditch MAP__{VARIABLE,FUNCTION}

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: https://lkml.kernel.org/n/tip-919d1k13ts62pjipnpibvgwd@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/db-export.c |  3 +--
 tools/perf/util/map.c       |  4 ++--
 tools/perf/util/symbol.c    | 10 +++++-----
 tools/perf/util/symbol.h    | 12 ++++++++----
 4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index b0c2b5c5d337..04fb1a99c737 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -315,8 +315,7 @@ static struct call_path *call_path_from_sample(struct db_export *dbe,
 		al.addr = node->ip;
 
 		if (al.map && !al.sym)
-			al.sym = dso__find_symbol(al.map->dso, MAP__FUNCTION,
-						  al.addr);
+			al.sym = dso__find_symbol(al.map->dso, al.addr);
 
 		db_ids_from_al(dbe, &al, &dso_db_id, &sym_db_id, &offset);
 
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 91e2afb010f8..ab12f2bc7669 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -353,7 +353,7 @@ struct symbol *map__find_symbol(struct map *map, u64 addr)
 	if (map__load(map) < 0)
 		return NULL;
 
-	return dso__find_symbol(map->dso, map->type, addr);
+	return __dso__find_symbol(map->dso, map->type, addr);
 }
 
 struct symbol *map__find_symbol_by_name(struct map *map, const char *name)
@@ -364,7 +364,7 @@ struct symbol *map__find_symbol_by_name(struct map *map, const char *name)
 	if (!dso__sorted_by_name(map->dso, map->type))
 		dso__sort_by_name(map->dso, map->type);
 
-	return dso__find_symbol_by_name(map->dso, map->type, name);
+	return __dso__find_symbol_by_name(map->dso, map->type, name);
 }
 
 struct map *map__clone(struct map *from)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 5d77c60e63bf..2b81ccc94a7e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -504,8 +504,8 @@ void dso__insert_symbol(struct dso *dso, enum map_type type, struct symbol *sym)
 	}
 }
 
-struct symbol *dso__find_symbol(struct dso *dso,
-				enum map_type type, u64 addr)
+struct symbol *__dso__find_symbol(struct dso *dso,
+				  enum map_type type, u64 addr)
 {
 	if (dso->last_find_result[type].addr != addr || dso->last_find_result[type].symbol == NULL) {
 		dso->last_find_result[type].addr   = addr;
@@ -549,10 +549,10 @@ struct symbol *symbol__next_by_name(struct symbol *sym)
 }
 
  /*
-  * Teturns first symbol that matched with @name.
+  * Returns first symbol that matched with @name.
   */
-struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
-					const char *name)
+struct symbol *__dso__find_symbol_by_name(struct dso *dso, enum map_type type,
+					  const char *name)
 {
 	struct symbol *s = symbols__find_by_name(&dso->symbol_names[type], name,
 						 SYMBOL_TAG_INCLUDE__NONE);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 924f465307b1..2b985ff2e725 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -262,10 +262,14 @@ int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map);
 void dso__insert_symbol(struct dso *dso, enum map_type type,
 			struct symbol *sym);
 
-struct symbol *dso__find_symbol(struct dso *dso, enum map_type type,
-				u64 addr);
-struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
-					const char *name);
+struct symbol *__dso__find_symbol(struct dso *dso, enum map_type type, u64 addr);
+struct symbol *__dso__find_symbol_by_name(struct dso *dso, enum map_type type, const char *name);
+
+static inline struct symbol *dso__find_symbol(struct dso *dso, u64 addr)
+{
+	return __dso__find_symbol(dso, MAP__FUNCTION, addr);
+}
+
 struct symbol *symbol__next_by_name(struct symbol *sym);
 
 struct symbol *dso__first_symbol(struct dso *dso);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ