evsel.c (0588000eac9ba4178cebade437da3b28e8fad48f) evsel.c (cac21425578abddc4e9f529845832a57ba27ce0f)
1/*
2 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
3 *
4 * Parts came from builtin-{top,stat,record}.c, see those files for further
5 * copyright notes.
6 *
7 * Released under the GPL v2. (and only v2, not any later version)
8 */

--- 390 unchanged lines hidden (view full) ---

399 break;
400 }
401
402 evsel->name = strdup(bf);
403
404 return evsel->name ?: "unknown";
405}
406
1/*
2 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
3 *
4 * Parts came from builtin-{top,stat,record}.c, see those files for further
5 * copyright notes.
6 *
7 * Released under the GPL v2. (and only v2, not any later version)
8 */

--- 390 unchanged lines hidden (view full) ---

399 break;
400 }
401
402 evsel->name = strdup(bf);
403
404 return evsel->name ?: "unknown";
405}
406
407void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts,
408 struct perf_evsel *first)
407void perf_evsel__config(struct perf_evsel *evsel,
408 struct perf_record_opts *opts)
409{
410 struct perf_event_attr *attr = &evsel->attr;
411 int track = !evsel->idx; /* only the first counter needs these */
412
413 attr->disabled = 1;
414 attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1;
415 attr->inherit = !opts->no_inherit;
416 attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |

--- 64 unchanged lines hidden (view full) ---

481 if (opts->branch_stack) {
482 attr->sample_type |= PERF_SAMPLE_BRANCH_STACK;
483 attr->branch_sample_type = opts->branch_stack;
484 }
485
486 attr->mmap = track;
487 attr->comm = track;
488
409{
410 struct perf_event_attr *attr = &evsel->attr;
411 int track = !evsel->idx; /* only the first counter needs these */
412
413 attr->disabled = 1;
414 attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1;
415 attr->inherit = !opts->no_inherit;
416 attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |

--- 64 unchanged lines hidden (view full) ---

481 if (opts->branch_stack) {
482 attr->sample_type |= PERF_SAMPLE_BRANCH_STACK;
483 attr->branch_sample_type = opts->branch_stack;
484 }
485
486 attr->mmap = track;
487 attr->comm = track;
488
489 if (perf_target__none(&opts->target) &&
490 (!opts->group || evsel == first)) {
489 if (perf_target__none(&opts->target) && (!evsel->leader))
491 attr->enable_on_exec = 1;
490 attr->enable_on_exec = 1;
492 }
493}
494
495int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
496{
497 int cpu, thread;
498 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int));
499
500 if (evsel->fd) {

--- 669 unchanged lines hidden ---
491}
492
493int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
494{
495 int cpu, thread;
496 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int));
497
498 if (evsel->fd) {

--- 669 unchanged lines hidden ---