Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __PERF_BLOCK_H
 3#define __PERF_BLOCK_H
 4
 5#include <linux/types.h>
 6#include <linux/refcount.h>
 7#include "hist.h"
 8#include "symbol.h"
 9#include "sort.h"
10#include "ui/ui.h"
11
12struct block_info {
13	struct symbol		*sym;
14	u64			start;
15	u64			end;
16	u64			cycles;
17	u64			cycles_aggr;
18	s64			cycles_spark[NUM_SPARKS];
19	u64			total_cycles;
20	int			num;
21	int			num_aggr;
22	refcount_t		refcnt;
 
 
23};
24
25struct block_fmt {
26	struct perf_hpp_fmt	fmt;
27	int			idx;
28	int			width;
29	const char		*header;
30	u64			total_cycles;
31	u64			block_cycles;
32};
33
34enum {
35	PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT,
36	PERF_HPP_REPORT__BLOCK_LBR_CYCLES,
37	PERF_HPP_REPORT__BLOCK_CYCLES_PCT,
38	PERF_HPP_REPORT__BLOCK_AVG_CYCLES,
39	PERF_HPP_REPORT__BLOCK_RANGE,
40	PERF_HPP_REPORT__BLOCK_DSO,
 
41	PERF_HPP_REPORT__BLOCK_MAX_INDEX
42};
43
44struct block_report {
45	struct block_hist	hist;
46	u64			cycles;
47	struct block_fmt	fmts[PERF_HPP_REPORT__BLOCK_MAX_INDEX];
48	int			nr_fmts;
49};
50
51struct block_hist;
52
53struct block_info *block_info__new(void);
54struct block_info *block_info__get(struct block_info *bi);
55void   block_info__put(struct block_info *bi);
56
57static inline void __block_info__zput(struct block_info **bi)
58{
59	block_info__put(*bi);
60	*bi = NULL;
61}
62
63#define block_info__zput(bi) __block_info__zput(&bi)
64
65int64_t __block_info__cmp(struct hist_entry *left, struct hist_entry *right);
66
67int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused,
68			struct hist_entry *left, struct hist_entry *right);
69
70int block_info__process_sym(struct hist_entry *he, struct block_hist *bh,
71			    u64 *block_cycles_aggr, u64 total_cycles);
 
72
73struct block_report *block_info__create_report(struct evlist *evlist,
74					       u64 total_cycles,
75					       int *block_hpps, int nr_hpps,
76					       int *nr_reps);
77
78void block_info__free_report(struct block_report *reps, int nr_reps);
79
80int report__browse_block_hists(struct block_hist *bh, float min_percent,
81			       struct evsel *evsel, struct perf_env *env);
82
83float block_info__total_cycles_percent(struct hist_entry *he);
84
85#endif /* __PERF_BLOCK_H */
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __PERF_BLOCK_H
 3#define __PERF_BLOCK_H
 4
 5#include <linux/types.h>
 
 6#include "hist.h"
 7#include "symbol.h"
 8#include "sort.h"
 9#include "ui/ui.h"
10
11struct block_info {
12	struct symbol		*sym;
13	u64			start;
14	u64			end;
15	u64			cycles;
16	u64			cycles_aggr;
17	s64			cycles_spark[NUM_SPARKS];
18	u64			total_cycles;
19	int			num;
20	int			num_aggr;
21	int			br_cntr_nr;
22	u64			*br_cntr;
23	struct evsel		*evsel;
24};
25
26struct block_fmt {
27	struct perf_hpp_fmt	fmt;
28	int			idx;
29	int			width;
30	const char		*header;
31	u64			total_cycles;
32	u64			block_cycles;
33};
34
35enum {
36	PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT,
37	PERF_HPP_REPORT__BLOCK_LBR_CYCLES,
38	PERF_HPP_REPORT__BLOCK_CYCLES_PCT,
39	PERF_HPP_REPORT__BLOCK_AVG_CYCLES,
40	PERF_HPP_REPORT__BLOCK_RANGE,
41	PERF_HPP_REPORT__BLOCK_DSO,
42	PERF_HPP_REPORT__BLOCK_BRANCH_COUNTER,
43	PERF_HPP_REPORT__BLOCK_MAX_INDEX
44};
45
46struct block_report {
47	struct block_hist	hist;
48	u64			cycles;
49	struct block_fmt	fmts[PERF_HPP_REPORT__BLOCK_MAX_INDEX];
50	int			nr_fmts;
51};
52
53void block_info__delete(struct block_info *bi);
 
 
 
 
 
 
 
 
 
 
 
 
54
55int64_t __block_info__cmp(struct hist_entry *left, struct hist_entry *right);
56
57int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused,
58			struct hist_entry *left, struct hist_entry *right);
59
60int block_info__process_sym(struct hist_entry *he, struct block_hist *bh,
61			    u64 *block_cycles_aggr, u64 total_cycles,
62			    unsigned int br_cntr_nr);
63
64struct block_report *block_info__create_report(struct evlist *evlist,
65					       u64 total_cycles,
66					       int *block_hpps, int nr_hpps,
67					       int *nr_reps);
68
69void block_info__free_report(struct block_report *reps, int nr_reps);
70
71int report__browse_block_hists(struct block_hist *bh, float min_percent,
72			       struct evsel *evsel, struct perf_env *env);
73
74float block_info__total_cycles_percent(struct hist_entry *he);
75
76#endif /* __PERF_BLOCK_H */