Skip to content

Commit bd9acd9

Browse files
captain5050acmel
authored andcommitted
perf symbols: Add documentation to 'struct symbol'
Refactor some existing comments and then infer the rest. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin Liška <mliska@suse.cz> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20211112035124.94327-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 7380aa8 commit bd9acd9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tools/perf/util/symbol.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,33 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
4040
GElf_Shdr *shp, const char *name, size_t *idx);
4141
#endif
4242

43-
/** struct symbol - symtab entry
44-
*
45-
* @ignore - resolvable but tools ignore it (e.g. idle routines)
43+
/**
44+
* A symtab entry. When allocated this may be preceded by an annotation (see
45+
* symbol__annotation), a browser_index (see symbol__browser_index) and rb_node
46+
* to sort by name (see struct symbol_name_rb_node).
4647
*/
4748
struct symbol {
4849
struct rb_node rb_node;
50+
/** Range of symbol [start, end). */
4951
u64 start;
5052
u64 end;
53+
/** Length of the string name. */
5154
u16 namelen;
55+
/** ELF symbol type as defined for st_info. E.g STT_OBJECT or STT_FUNC. */
5256
u8 type:4;
57+
/** ELF binding type as defined for st_info. E.g. STB_WEAK or STB_GLOBAL. */
5358
u8 binding:4;
59+
/** Set true for kernel symbols of idle routines. */
5460
u8 idle:1;
61+
/** Resolvable but tools ignore it (e.g. idle routines). */
5562
u8 ignore:1;
63+
/** Symbol for an inlined function. */
5664
u8 inlined:1;
65+
/** Architecture specific. Unused except on PPC where it holds st_other. */
5766
u8 arch_sym;
67+
/** Has symbol__annotate2 been performed. */
5868
bool annotate2;
69+
/** The name of length namelen associated with the symbol. */
5970
char name[];
6071
};
6172

0 commit comments

Comments
 (0)