Skip to content

Commit

Permalink
perf symbols: Add documentation to 'struct symbol'
Browse files Browse the repository at this point in the history
Refactor some existing comments and then infer the rest.

Signed-off-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kajol Jain <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Martin Liška <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
captain5050 authored and acmel committed Nov 13, 2021
1 parent 7380aa8 commit bd9acd9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,33 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
GElf_Shdr *shp, const char *name, size_t *idx);
#endif

/** struct symbol - symtab entry
*
* @ignore - resolvable but tools ignore it (e.g. idle routines)
/**
* A symtab entry. When allocated this may be preceded by an annotation (see
* symbol__annotation), a browser_index (see symbol__browser_index) and rb_node
* to sort by name (see struct symbol_name_rb_node).
*/
struct symbol {
struct rb_node rb_node;
/** Range of symbol [start, end). */
u64 start;
u64 end;
/** Length of the string name. */
u16 namelen;
/** ELF symbol type as defined for st_info. E.g STT_OBJECT or STT_FUNC. */
u8 type:4;
/** ELF binding type as defined for st_info. E.g. STB_WEAK or STB_GLOBAL. */
u8 binding:4;
/** Set true for kernel symbols of idle routines. */
u8 idle:1;
/** Resolvable but tools ignore it (e.g. idle routines). */
u8 ignore:1;
/** Symbol for an inlined function. */
u8 inlined:1;
/** Architecture specific. Unused except on PPC where it holds st_other. */
u8 arch_sym;
/** Has symbol__annotate2 been performed. */
bool annotate2;
/** The name of length namelen associated with the symbol. */
char name[];
};

Expand Down

0 comments on commit bd9acd9

Please sign in to comment.