14 #include <linux/kernel.h> 81 for (k = 0; k < ARRAY_SIZE(fake_common_samples); k++) {
82 sample.
cpumode = PERF_RECORD_MISC_USER;
83 sample.
pid = fake_common_samples[k].
pid;
84 sample.
tid = fake_common_samples[k].
pid;
85 sample.
ip = fake_common_samples[k].
ip;
91 NULL, NULL, &sample,
true);
98 fake_common_samples[k].
map = al.
map;
99 fake_common_samples[k].
sym = al.
sym;
102 for (k = 0; k < ARRAY_SIZE(fake_samples[i]); k++) {
103 sample.
pid = fake_samples[i][k].
pid;
104 sample.
tid = fake_samples[i][k].
pid;
105 sample.
ip = fake_samples[i][k].
ip;
110 NULL, NULL, &sample,
true);
117 fake_samples[i][k].
map = al.
map;
118 fake_samples[i][k].
sym = al.
sym;
126 pr_debug(
"Not enough memory for adding a hist entry\n");
133 while (nr_samples--) {
134 if (samples->
thread == t && samples->
map == m &&
145 struct rb_root *
root;
146 struct rb_node *
node;
156 node = rb_first(root);
164 ARRAY_SIZE(fake_common_samples),
168 pr_debug(
"Can't find the matched entry\n");
173 node = rb_next(node);
176 if (count != ARRAY_SIZE(fake_common_samples)) {
177 pr_debug(
"Invalid count for matched entries: %zd of %zd\n",
178 count, ARRAY_SIZE(fake_common_samples));
193 size_t count_pair = 0;
194 size_t count_dummy = 0;
195 struct rb_root *
root;
196 struct rb_node *
node;
208 node = rb_first(root);
216 ARRAY_SIZE(fake_common_samples),
219 ARRAY_SIZE(fake_samples[idx]),
225 pr_debug(
"A entry from the other hists should have pair\n");
230 node = rb_next(node);
237 if (count_dummy != ARRAY_SIZE(fake_samples[1]) - 1) {
238 pr_debug(
"Invalid count of dummy entries: %zd of %zd\n",
239 count_dummy, ARRAY_SIZE(fake_samples[1]) - 1);
242 if (count != count_pair + ARRAY_SIZE(fake_samples[0])) {
243 pr_debug(
"Invalid count of total leader entries: %zd of %zd\n",
244 count, count_pair + ARRAY_SIZE(fake_samples[0]));
248 if (count != count_pair) {
249 pr_debug(
"Invalid count of total other entries: %zd of %zd\n",
253 if (count_dummy > 0) {
254 pr_debug(
"Other hists should not have dummy entries: %zd\n",
#define FAKE_IP_BASH_XMALLOC
static void setup_sorting(struct perf_sched *sched, const struct option *options, const char *const usage_msg[])
struct rb_root * entries_in
static int __validate_match(struct hists *hists)
void machines__exit(struct machines *machines)
#define FAKE_IP_KERNEL_SYS_PERF_EVENT_OPEN
int machine__resolve(struct machine *machine, struct addr_location *al, struct perf_sample *sample)
static int validate_link(struct hists *leader, struct hists *other)
int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unused)
static bool hist_entry__has_pairs(struct hist_entry *he)
void reset_output_field(void)
int hists__link(struct hists *leader, struct hists *other)
#define FAKE_IP_BASH_XFREE
struct hist_entry * hists__add_entry(struct hists *hists, struct addr_location *al, struct symbol *sym_parent, struct branch_info *bi, struct mem_info *mi, struct perf_sample *sample, bool sample_self)
int hists__collapse_resort(struct hists *hists, struct ui_progress *prog)
#define FAKE_IP_LIBC_MALLOC
void perf_evlist__delete(struct perf_evlist *evlist)
#define FAKE_IP_LIBC_REALLOC
static struct hists * evsel__hists(struct perf_evsel *evsel)
int parse_events(struct perf_evlist *evlist, const char *str, struct parse_events_error *err)
void addr_location__put(struct addr_location *al)
#define pr_debug(fmt,...)
#define FAKE_IP_PERF_MAIN
#define FAKE_IP_KERNEL_SCHEDULE
#define evlist__for_each_entry(evlist, evsel)
void print_hists_in(struct hists *hists)
static int validate_match(struct hists *leader, struct hists *other)
static struct sample fake_common_samples[]
#define hists__has(__h, __f)
static int find_sample(struct sample *samples, size_t nr_samples, struct thread *t, struct map *m, struct symbol *s)
#define FAKE_IP_PERF_CMD_RECORD
static struct sample fake_samples[][5]
struct rb_node rb_node_in
static struct perf_evsel * perf_evlist__first(struct perf_evlist *evlist)
void hists__match(struct hists *leader, struct hists *other)
void machines__init(struct machines *machines)
static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
#define FAKE_IP_PERF_RUN_COMMAND
#define FAKE_IP_KERNEL_PAGE_FAULT
static struct perf_evsel * perf_evlist__last(struct perf_evlist *evlist)
struct machine * setup_fake_machine(struct machines *machines)
static int __validate_link(struct hists *hists, int idx)
struct rb_root entries_collapsed
#define FAKE_IP_LIBC_FREE
size_t machine__fprintf(struct machine *machine, FILE *fp)
struct perf_evlist * perf_evlist__new(void)