annotate.h (6d5a763c303bc9d78b17361d30b692ba2facf9b4) annotate.h (2975489458c59ce2e348b1b3aef5d8d2acb5cc8d)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PERF_ANNOTATE_H
3#define __PERF_ANNOTATE_H
4
5#include <stdbool.h>
6#include <stdint.h>
7#include <stdio.h>
8#include <linux/types.h>
9#include <linux/list.h>
10#include <linux/rbtree.h>
11#include <pthread.h>
12#include <asm/bug.h>
13#include "symbol_conf.h"
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PERF_ANNOTATE_H
3#define __PERF_ANNOTATE_H
4
5#include <stdbool.h>
6#include <stdint.h>
7#include <stdio.h>
8#include <linux/types.h>
9#include <linux/list.h>
10#include <linux/rbtree.h>
11#include <pthread.h>
12#include <asm/bug.h>
13#include "symbol_conf.h"
14#include "spark.h"
14
15struct hist_browser_timer;
16struct hist_entry;
17struct ins_ops;
18struct map;
19struct map_symbol;
20struct addr_map_symbol;
21struct option;

--- 208 unchanged lines hidden (view full) ---

230};
231
232struct cyc_hist {
233 u64 start;
234 u64 cycles;
235 u64 cycles_aggr;
236 u64 cycles_max;
237 u64 cycles_min;
15
16struct hist_browser_timer;
17struct hist_entry;
18struct ins_ops;
19struct map;
20struct map_symbol;
21struct addr_map_symbol;
22struct option;

--- 208 unchanged lines hidden (view full) ---

231};
232
233struct cyc_hist {
234 u64 start;
235 u64 cycles;
236 u64 cycles_aggr;
237 u64 cycles_max;
238 u64 cycles_min;
239 s64 cycles_spark[NUM_SPARKS];
238 u32 num;
239 u32 num_aggr;
240 u8 have_start;
241 /* 1 byte padding */
242 u16 reset;
243};
244
245/** struct annotated_source - symbols with hits have this attached as in sannotation

--- 96 unchanged lines hidden (view full) ---

342 unsigned cycles);
343
344int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *sample,
345 struct evsel *evsel, u64 addr);
346
347struct annotated_source *symbol__hists(struct symbol *sym, int nr_hists);
348void symbol__annotate_zero_histograms(struct symbol *sym);
349
240 u32 num;
241 u32 num_aggr;
242 u8 have_start;
243 /* 1 byte padding */
244 u16 reset;
245};
246
247/** struct annotated_source - symbols with hits have this attached as in sannotation

--- 96 unchanged lines hidden (view full) ---

344 unsigned cycles);
345
346int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *sample,
347 struct evsel *evsel, u64 addr);
348
349struct annotated_source *symbol__hists(struct symbol *sym, int nr_hists);
350void symbol__annotate_zero_histograms(struct symbol *sym);
351
350int symbol__annotate(struct symbol *sym, struct map *map,
352int symbol__annotate(struct map_symbol *ms,
351 struct evsel *evsel, size_t privsize,
352 struct annotation_options *options,
353 struct arch **parch);
353 struct evsel *evsel, size_t privsize,
354 struct annotation_options *options,
355 struct arch **parch);
354int symbol__annotate2(struct symbol *sym, struct map *map,
356int symbol__annotate2(struct map_symbol *ms,
355 struct evsel *evsel,
356 struct annotation_options *options,
357 struct arch **parch);
358
359enum symbol_disassemble_errno {
360 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0,
361
362 /*

--- 10 unchanged lines hidden (view full) ---

373 SYMBOL_ANNOTATE_ERRNO__ARCH_INIT_CPUID_PARSING,
374 SYMBOL_ANNOTATE_ERRNO__ARCH_INIT_REGEXP,
375 SYMBOL_ANNOTATE_ERRNO__BPF_INVALID_FILE,
376 SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF,
377
378 __SYMBOL_ANNOTATE_ERRNO__END,
379};
380
357 struct evsel *evsel,
358 struct annotation_options *options,
359 struct arch **parch);
360
361enum symbol_disassemble_errno {
362 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0,
363
364 /*

--- 10 unchanged lines hidden (view full) ---

375 SYMBOL_ANNOTATE_ERRNO__ARCH_INIT_CPUID_PARSING,
376 SYMBOL_ANNOTATE_ERRNO__ARCH_INIT_REGEXP,
377 SYMBOL_ANNOTATE_ERRNO__BPF_INVALID_FILE,
378 SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF,
379
380 __SYMBOL_ANNOTATE_ERRNO__END,
381};
382
381int symbol__strerror_disassemble(struct symbol *sym, struct map *map,
382 int errnum, char *buf, size_t buflen);
383int symbol__strerror_disassemble(struct map_symbol *ms, int errnum, char *buf, size_t buflen);
383
384
384int symbol__annotate_printf(struct symbol *sym, struct map *map,
385 struct evsel *evsel,
385int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel,
386 struct annotation_options *options);
387void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
388void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
389void annotated_source__purge(struct annotated_source *as);
390
391int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel,
392 struct annotation_options *opts);
393
394bool ui__has_annotation(void);
395
386 struct annotation_options *options);
387void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
388void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
389void annotated_source__purge(struct annotated_source *as);
390
391int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel,
392 struct annotation_options *opts);
393
394bool ui__has_annotation(void);
395
396int symbol__tty_annotate(struct symbol *sym, struct map *map,
397 struct evsel *evsel, struct annotation_options *opts);
396int symbol__tty_annotate(struct map_symbol *ms, struct evsel *evsel, struct annotation_options *opts);
398
397
399int symbol__tty_annotate2(struct symbol *sym, struct map *map,
400 struct evsel *evsel, struct annotation_options *opts);
398int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel, struct annotation_options *opts);
401
402#ifdef HAVE_SLANG_SUPPORT
399
400#ifdef HAVE_SLANG_SUPPORT
403int symbol__tui_annotate(struct symbol *sym, struct map *map,
404 struct evsel *evsel,
401int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
405 struct hist_browser_timer *hbt,
406 struct annotation_options *opts);
407#else
402 struct hist_browser_timer *hbt,
403 struct annotation_options *opts);
404#else
408static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused,
409 struct map *map __maybe_unused,
405static inline int symbol__tui_annotate(struct map_symbol *ms __maybe_unused,
410 struct evsel *evsel __maybe_unused,
411 struct hist_browser_timer *hbt __maybe_unused,
412 struct annotation_options *opts __maybe_unused)
413{
414 return 0;
415}
416#endif
417
418void annotation_config__init(void);
419
420int annotate_parse_percent_type(const struct option *opt, const char *_str,
421 int unset);
422#endif /* __PERF_ANNOTATE_H */
406 struct evsel *evsel __maybe_unused,
407 struct hist_browser_timer *hbt __maybe_unused,
408 struct annotation_options *opts __maybe_unused)
409{
410 return 0;
411}
412#endif
413
414void annotation_config__init(void);
415
416int annotate_parse_percent_type(const struct option *opt, const char *_str,
417 int unset);
418#endif /* __PERF_ANNOTATE_H */