Home | History | Annotate | Download | only in daemon

Lines Matching refs:trans

42 sfile_hash(struct transient const * trans, struct kernel_image * ki)
47 val ^= trans->tid << 2;
48 val ^= trans->tgid << 2;
51 if (separate_kernel || ((trans->anon || separate_lib) && !ki))
52 val ^= trans->app_cookie >> (DCOOKIE_SHIFT + 3);
55 val ^= trans->cpu;
58 if (trans->in_kernel) {
64 if (trans->cookie != NO_COOKIE) {
65 val ^= trans->cookie >> DCOOKIE_SHIFT;
70 val ^= trans->tgid << 2;
72 if (trans->anon) {
73 val ^= trans->anon->start >> VMA_SHIFT;
74 val ^= trans->anon->end >> (VMA_SHIFT + 1);
108 /* ignore the cached trans->cookie for kernel images,
122 trans_match(struct transient const * trans, struct sfile const * sfile,
125 return do_match(sfile, trans->cookie, trans->app_cookie, ki,
126 trans->anon, trans->tgid, trans->tid, trans->cpu);
163 create_sfile(unsigned long hash, struct transient const * trans,
176 sf->cookie = trans->in_kernel ? INVALID_COOKIE : trans->cookie;
182 sf->anon = trans->anon;
187 if (trans->ext)
196 sf->tid = trans->tid;
197 if (separate_thread || trans->cookie == NO_COOKIE)
198 sf->tgid = trans->tgid;
201 sf->cpu = trans->cpu;
203 if (separate_kernel || ((trans->anon || separate_lib) && !ki))
204 sf->app_cookie = trans->app_cookie;
208 sf->embedded_offset = trans->embedded_offset;
212 * want sf->app_cookie to hold trans->app_cookie.
214 if (trans->embedded_offset != UNUSED_EMBEDDED_OFFSET)
215 sf->app_cookie = trans->app_cookie;
220 struct sfile * sfile_find(struct transient const * trans)
227 if (trans->tracing != TRACING_ON) {
229 opd_stats[trans->in_kernel == 1 ? OPD_KERNEL : OPD_PROCESS]++;
235 if (trans->in_kernel == -1) {
237 trans->pc);
243 if (trans->in_kernel) {
244 ki = find_kernel_image(trans);
246 verbprintf(vsamples, "Lost kernel sample %llx\n", trans->pc);
250 } else if (trans->cookie == NO_COOKIE && !trans->anon) {
252 char const * app = verbose_cookie(trans->app_cookie);
254 trans->pc, app);
260 hash = sfile_hash(trans, ki);
263 if (trans_match(trans, sf, ki)) {
269 sf = create_sfile(hash, trans, ki);
297 static odb_t * get_file(struct transient const * trans, int is_cg)
299 struct sfile * sf = trans->current;
300 struct sfile * last = trans->last;
306 if ((trans->ext) != NULL)
307 return opd_ext_sfile_get(trans, is_cg);
309 if (trans->event >= op_nr_counters) {
311 trans->event);
315 file = &sf->files[trans->event];
328 file = &cg->to.files[trans->event];
336 file = &cg->to.files[trans->event];
340 opd_open_sample_file(file, last, sf, trans->event, is_cg);
368 static void verbose_sample(struct transient const * trans, vma_t pc)
371 verbose_print_sample(trans->current, pc, trans->event);
377 verbose_arc(struct transient const * trans, vma_t from, vma_t to)
380 verbose_print_sample(trans->current, from, trans->event);
386 static void sfile_log_arc(struct transient const * trans)
389 vma_t from = trans->pc;
390 vma_t to = trans->last_pc;
394 file = get_file(trans, 1);
397 if (trans->current->kernel)
398 from -= trans->current->kernel->start;
400 if (trans->last->kernel)
401 to -= trans->last->kernel->start;
403 if (trans->current->anon)
404 from -= trans->current->anon->start;
406 if (trans->last->anon)
407 to -= trans->last->anon->start;
410 verbose_arc(trans, from, to);
429 void sfile_log_sample(struct transient const * trans)
431 sfile_log_sample_count(trans, 1);
435 void sfile_log_sample_count(struct transient const * trans,
439 vma_t pc = trans->pc;
442 if (trans->tracing == TRACING_ON) {
445 if (trans->last)
446 sfile_log_arc(trans);
450 file = get_file(trans, 0);
453 if (trans->current->kernel)
454 pc -= trans->current->kernel->start;
456 if (trans->current->anon)
457 pc -= trans->current->anon->start;
460 verbose_sample(trans, pc);