Skip to content

Commit 32add10

Browse files
captain5050acmel
authored andcommitted
libsymbols kallsyms: Move hex2u64 out of header
hex2u64 is a helper that's out of place in kallsyms.h as not being kallsyms related. Move from kallsyms.h to the only user. Committer notes: Move it out of tools/lib/symbol/kallsyms.c as well, as we had to leave it there in the previous patch lest we break the build. Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 53df2b9 commit 32add10

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

tools/lib/symbol/kallsyms.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@ u8 kallsyms2elf_type(char type)
1111
return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT;
1212
}
1313

14-
/*
15-
* While we find nice hex chars, build a long_val.
16-
* Return number of chars processed.
17-
*/
18-
int hex2u64(const char *ptr, u64 *long_val)
19-
{
20-
char *p;
21-
22-
*long_val = strtoull(ptr, &p, 16);
23-
24-
return p - ptr;
25-
}
26-
2714
bool kallsyms__is_function(char symbol_type)
2815
{
2916
symbol_type = toupper(symbol_type);

tools/lib/symbol/kallsyms.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ static inline u8 kallsyms2elf_binding(char type)
1818
return isupper(type) ? STB_GLOBAL : STB_LOCAL;
1919
}
2020

21-
int hex2u64(const char *ptr, u64 *long_val);
22-
2321
u8 kallsyms2elf_type(char type);
2422

2523
bool kallsyms__is_function(char symbol_type);

tools/perf/util/symbol.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,20 @@ void dso__sort_by_name(struct dso *dso)
566566
return symbols__sort_by_name(&dso->symbol_names, &dso->symbols);
567567
}
568568

569+
/*
570+
* While we find nice hex chars, build a long_val.
571+
* Return number of chars processed.
572+
*/
573+
static int hex2u64(const char *ptr, u64 *long_val)
574+
{
575+
char *p;
576+
577+
*long_val = strtoull(ptr, &p, 16);
578+
579+
return p - ptr;
580+
}
581+
582+
569583
int modules__parse(const char *filename, void *arg,
570584
int (*process_module)(void *arg, const char *name,
571585
u64 start, u64 size))

0 commit comments

Comments
 (0)