aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-10-31 02:56:03 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-04 18:59:09 -0500
commit41a4e6e2a0237e8ac895f43158ef7c91ab7af157 (patch)
tree3ab45245e866404b7bc05b494e6770fc580d408a /tools/perf/util/hist.c
parent87968f94fbea47df334502a0db645833ce8a848b (diff)
perf hists: Consolidate __hists__add_*entry()
The __hists__add_{branch,mem}_entry() does almost the same thing that __hists__add_entry() does. Consolidate them into one. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Rodrigo Campos <rodrigo@sdfg.com.ar> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1383202576-28141-2-git-send-email-namhyung@kernel.org [ Fixup clash with new COMM infrastructure ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c75
1 files changed, 7 insertions, 68 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 30793f98c8bb..822903eaa201 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -407,73 +407,12 @@ out:
407 return he; 407 return he;
408} 408}
409 409
410struct hist_entry *__hists__add_mem_entry(struct hists *hists,
411 struct addr_location *al,
412 struct symbol *sym_parent,
413 struct mem_info *mi,
414 u64 period,
415 u64 weight)
416{
417 struct hist_entry entry = {
418 .thread = al->thread,
419 .comm = thread__comm(al->thread),
420 .ms = {
421 .map = al->map,
422 .sym = al->sym,
423 },
424 .stat = {
425 .period = period,
426 .weight = weight,
427 .nr_events = 1,
428 },
429 .cpu = al->cpu,
430 .ip = al->addr,
431 .level = al->level,
432 .parent = sym_parent,
433 .filtered = symbol__parent_filter(sym_parent),
434 .hists = hists,
435 .mem_info = mi,
436 .branch_info = NULL,
437 };
438 return add_hist_entry(hists, &entry, al, period, weight);
439}
440
441struct hist_entry *__hists__add_branch_entry(struct hists *hists,
442 struct addr_location *al,
443 struct symbol *sym_parent,
444 struct branch_info *bi,
445 u64 period,
446 u64 weight)
447{
448 struct hist_entry entry = {
449 .thread = al->thread,
450 .comm = thread__comm(al->thread),
451 .ms = {
452 .map = bi->to.map,
453 .sym = bi->to.sym,
454 },
455 .cpu = al->cpu,
456 .ip = bi->to.addr,
457 .level = al->level,
458 .stat = {
459 .period = period,
460 .nr_events = 1,
461 .weight = weight,
462 },
463 .parent = sym_parent,
464 .filtered = symbol__parent_filter(sym_parent),
465 .branch_info = bi,
466 .hists = hists,
467 .mem_info = NULL,
468 };
469
470 return add_hist_entry(hists, &entry, al, period, weight);
471}
472
473struct hist_entry *__hists__add_entry(struct hists *hists, 410struct hist_entry *__hists__add_entry(struct hists *hists,
474 struct addr_location *al, 411 struct addr_location *al,
475 struct symbol *sym_parent, u64 period, 412 struct symbol *sym_parent,
476 u64 weight, u64 transaction) 413 struct branch_info *bi,
414 struct mem_info *mi,
415 u64 period, u64 weight, u64 transaction)
477{ 416{
478 struct hist_entry entry = { 417 struct hist_entry entry = {
479 .thread = al->thread, 418 .thread = al->thread,
@@ -486,15 +425,15 @@ struct hist_entry *__hists__add_entry(struct hists *hists,
486 .ip = al->addr, 425 .ip = al->addr,
487 .level = al->level, 426 .level = al->level,
488 .stat = { 427 .stat = {
489 .period = period,
490 .nr_events = 1, 428 .nr_events = 1,
429 .period = period,
491 .weight = weight, 430 .weight = weight,
492 }, 431 },
493 .parent = sym_parent, 432 .parent = sym_parent,
494 .filtered = symbol__parent_filter(sym_parent), 433 .filtered = symbol__parent_filter(sym_parent),
495 .hists = hists, 434 .hists = hists,
496 .branch_info = NULL, 435 .branch_info = bi,
497 .mem_info = NULL, 436 .mem_info = mi,
498 .transaction = transaction, 437 .transaction = transaction,
499 }; 438 };
500 439