Lines Matching defs:dbe

24 int db_export__init(struct db_export *dbe)
26 memset(dbe, 0, sizeof(struct db_export));
30 void db_export__exit(struct db_export *dbe)
32 call_return_processor__free(dbe->crp);
33 dbe->crp = NULL;
36 int db_export__evsel(struct db_export *dbe, struct evsel *evsel)
41 evsel->db_id = ++dbe->evsel_last_db_id;
43 if (dbe->export_evsel)
44 return dbe->export_evsel(dbe, evsel);
49 int db_export__machine(struct db_export *dbe, struct machine *machine)
54 machine->db_id = ++dbe->machine_last_db_id;
56 if (dbe->export_machine)
57 return dbe->export_machine(dbe, machine);
62 int db_export__thread(struct db_export *dbe, struct thread *thread,
70 thread__set_db_id(thread, ++dbe->thread_last_db_id);
75 if (dbe->export_thread)
76 return dbe->export_thread(dbe, thread, main_thread_db_id,
82 static int __db_export__comm(struct db_export *dbe, struct comm *comm,
85 comm->db_id = ++dbe->comm_last_db_id;
87 if (dbe->export_comm)
88 return dbe->export_comm(dbe, comm, thread);
93 int db_export__comm(struct db_export *dbe, struct comm *comm,
99 return __db_export__comm(dbe, comm, thread);
108 int db_export__exec_comm(struct db_export *dbe, struct comm *comm,
116 err = __db_export__comm(dbe, comm, main_thread);
130 return db_export__comm_thread(dbe, comm, main_thread);
133 int db_export__comm_thread(struct db_export *dbe, struct comm *comm,
138 db_id = ++dbe->comm_thread_last_db_id;
140 if (dbe->export_comm_thread)
141 return dbe->export_comm_thread(dbe, db_id, comm, thread);
146 int db_export__dso(struct db_export *dbe, struct dso *dso,
152 dso->db_id = ++dbe->dso_last_db_id;
154 if (dbe->export_dso)
155 return dbe->export_dso(dbe, dso, machine);
160 int db_export__symbol(struct db_export *dbe, struct symbol *sym,
168 *sym_db_id = ++dbe->symbol_last_db_id;
170 if (dbe->export_symbol)
171 return dbe->export_symbol(dbe, sym, dso);
176 static int db_ids_from_al(struct db_export *dbe, struct addr_location *al,
184 err = db_export__dso(dbe, dso, maps__machine(al->maps));
198 err = db_export__symbol(dbe, al->sym, dso);
209 static struct call_path *call_path_from_sample(struct db_export *dbe,
216 struct call_path *current = &dbe->cpr->call_path;
263 db_ids_from_al(dbe, &al, &dso_db_id, &sym_db_id, &offset);
266 current = call_path__findnew(dbe->cpr, current,
277 if (current == &dbe->cpr->call_path) {
285 int db_export__branch_type(struct db_export *dbe, u32 branch_type,
288 if (dbe->export_branch_type)
289 return dbe->export_branch_type(dbe, branch_type, name);
294 static int db_export__threads(struct db_export *dbe, struct thread *thread,
307 err = db_export__thread(dbe, main_thread, machine, main_thread);
316 err = db_export__exec_comm(dbe, comm, main_thread);
330 err = db_export__thread(dbe, thread, machine, main_thread);
335 err = db_export__comm_thread(dbe, comm, thread);
343 return db_export__comm(dbe, curr_comm, thread);
348 int db_export__sample(struct db_export *dbe, union perf_event *event,
364 err = db_export__evsel(dbe, evsel);
369 err = db_export__machine(dbe, machine);
375 err = db_export__threads(dbe, thread, main_thread, machine, &comm);
382 es.db_id = ++dbe->sample_last_db_id;
384 err = db_ids_from_al(dbe, al, &es.dso_db_id, &es.sym_db_id, &es.offset);
388 if (dbe->cpr) {
389 struct call_path *cp = call_path_from_sample(dbe, machine,
393 db_export__call_path(dbe, cp);
399 err = db_ids_from_al(dbe, addr_al, &es.addr_dso_db_id,
403 if (dbe->crp) {
406 dbe->crp);
412 if (dbe->export_sample)
413 err = dbe->export_sample(dbe, &es);
448 int db_export__branch_types(struct db_export *dbe)
453 err = db_export__branch_type(dbe, branch_types[i].branch_type,
470 err = db_export__branch_type(dbe, type | PERF_IP_FLAG_TRACE_BEGIN, buf);
475 err = db_export__branch_type(dbe, type | PERF_IP_FLAG_TRACE_END, buf);
483 int db_export__call_path(struct db_export *dbe, struct call_path *cp)
491 err = db_export__call_path(dbe, cp->parent);
496 cp->db_id = ++dbe->call_path_last_db_id;
498 if (dbe->export_call_path)
499 return dbe->export_call_path(dbe, cp);
504 int db_export__call_return(struct db_export *dbe, struct call_return *cr,
509 err = db_export__call_path(dbe, cr->cp);
514 cr->db_id = ++dbe->call_return_last_db_id;
518 *parent_db_id = ++dbe->call_return_last_db_id;
522 if (dbe->export_call_return)
523 return dbe->export_call_return(dbe, cr);
528 static int db_export__pid_tid(struct db_export *dbe, struct machine *machine,
543 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr);
554 int db_export__switch(struct db_export *dbe, union perf_event *event,
570 err = db_export__machine(dbe, machine);
574 err = db_export__pid_tid(dbe, machine, sample->pid, sample->tid,
583 err = db_export__pid_tid(dbe, machine, pid, tid, &th_b_id,
596 db_id = ++dbe->context_switch_last_db_id;
610 if (dbe->export_context_switch)
611 return dbe->export_context_switch(dbe, db_id, machine, sample,