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->db_id = ++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, al->maps->machine);
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;
260 db_ids_from_al(dbe, &al, &dso_db_id, &sym_db_id, &offset);
263 current = call_path__findnew(dbe->cpr, current,
273 if (current == &dbe->cpr->call_path) {
281 int db_export__branch_type(struct db_export *dbe, u32 branch_type,
284 if (dbe->export_branch_type)
285 return dbe->export_branch_type(dbe, branch_type, name);
290 static int db_export__threads(struct db_export *dbe, struct thread *thread,
303 err = db_export__thread(dbe, main_thread, machine, main_thread);
312 err = db_export__exec_comm(dbe, comm, main_thread);
326 err = db_export__thread(dbe, thread, machine, main_thread);
331 err = db_export__comm_thread(dbe, comm, thread);
339 return db_export__comm(dbe, curr_comm, thread);
344 int db_export__sample(struct db_export *dbe, union perf_event *event,
359 err = db_export__evsel(dbe, evsel);
363 err = db_export__machine(dbe, al->maps->machine);
369 err = db_export__threads(dbe, thread, main_thread, al->maps->machine, &comm);
376 es.db_id = ++dbe->sample_last_db_id;
378 err = db_ids_from_al(dbe, al, &es.dso_db_id, &es.sym_db_id, &es.offset);
382 if (dbe->cpr) {
383 struct call_path *cp = call_path_from_sample(dbe, al->maps->machine,
387 db_export__call_path(dbe, cp);
397 err = db_ids_from_al(dbe, &addr_al, &es.addr_dso_db_id,
401 if (dbe->crp) {
404 dbe->crp);
410 if (dbe->export_sample)
411 err = dbe->export_sample(dbe, &es);
444 int db_export__branch_types(struct db_export *dbe)
449 err = db_export__branch_type(dbe, branch_types[i].branch_type,
466 err = db_export__branch_type(dbe, type | PERF_IP_FLAG_TRACE_BEGIN, buf);
471 err = db_export__branch_type(dbe, type | PERF_IP_FLAG_TRACE_END, buf);
479 int db_export__call_path(struct db_export *dbe, struct call_path *cp)
487 err = db_export__call_path(dbe, cp->parent);
492 cp->db_id = ++dbe->call_path_last_db_id;
494 if (dbe->export_call_path)
495 return dbe->export_call_path(dbe, cp);
500 int db_export__call_return(struct db_export *dbe, struct call_return *cr,
505 err = db_export__call_path(dbe, cr->cp);
510 cr->db_id = ++dbe->call_return_last_db_id;
514 *parent_db_id = ++dbe->call_return_last_db_id;
518 if (dbe->export_call_return)
519 return dbe->export_call_return(dbe, cr);
524 static int db_export__pid_tid(struct db_export *dbe, struct machine *machine,
539 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr);
550 int db_export__switch(struct db_export *dbe, union perf_event *event,
566 err = db_export__machine(dbe, machine);
570 err = db_export__pid_tid(dbe, machine, sample->pid, sample->tid,
579 err = db_export__pid_tid(dbe, machine, pid, tid, &th_b_id,
592 db_id = ++dbe->context_switch_last_db_id;
606 if (dbe->export_context_switch)
607 return dbe->export_context_switch(dbe, db_id, machine, sample,