evsel.c (d095ad45e2d808a5c8c047b5c8d5e0fad7fec4e4) evsel.c (34af56afacd82ed585ad9cfc51a3a783ad371b26)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
4 *
5 * Parts came from builtin-{top,stat,record}.c, see those files for further
6 * copyright notes.
7 */
8

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

840 return ret;
841}
842
843static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *opts,
844 struct callchain_param *param)
845{
846 bool function = evsel__is_function_event(evsel);
847 struct perf_event_attr *attr = &evsel->core.attr;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
4 *
5 * Parts came from builtin-{top,stat,record}.c, see those files for further
6 * copyright notes.
7 */
8

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

840 return ret;
841}
842
843static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *opts,
844 struct callchain_param *param)
845{
846 bool function = evsel__is_function_event(evsel);
847 struct perf_event_attr *attr = &evsel->core.attr;
848 const char *arch = perf_env__arch(evsel__env(evsel));
848
849 evsel__set_sample_bit(evsel, CALLCHAIN);
850
851 attr->sample_max_stack = param->max_stack;
852
853 if (opts->kernel_callchains)
854 attr->exclude_callchain_user = 1;
855 if (opts->user_callchains)

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

872 pr_warning("Cannot use LBR callstack with branch stack. "
873 "Falling back to framepointers.\n");
874 }
875
876 if (param->record_mode == CALLCHAIN_DWARF) {
877 if (!function) {
878 evsel__set_sample_bit(evsel, REGS_USER);
879 evsel__set_sample_bit(evsel, STACK_USER);
849
850 evsel__set_sample_bit(evsel, CALLCHAIN);
851
852 attr->sample_max_stack = param->max_stack;
853
854 if (opts->kernel_callchains)
855 attr->exclude_callchain_user = 1;
856 if (opts->user_callchains)

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

873 pr_warning("Cannot use LBR callstack with branch stack. "
874 "Falling back to framepointers.\n");
875 }
876
877 if (param->record_mode == CALLCHAIN_DWARF) {
878 if (!function) {
879 evsel__set_sample_bit(evsel, REGS_USER);
880 evsel__set_sample_bit(evsel, STACK_USER);
880 if (opts->sample_user_regs && DWARF_MINIMAL_REGS != PERF_REGS_MASK) {
881 attr->sample_regs_user |= DWARF_MINIMAL_REGS;
881 if (opts->sample_user_regs &&
882 DWARF_MINIMAL_REGS(arch) != PERF_REGS_MASK) {
883 attr->sample_regs_user |= DWARF_MINIMAL_REGS(arch);
882 pr_warning("WARNING: The use of --call-graph=dwarf may require all the user registers, "
883 "specifying a subset with --user-regs may render DWARF unwinding unreliable, "
884 "so the minimal registers set (IP, SP) is explicitly forced.\n");
885 } else {
886 attr->sample_regs_user |= arch__user_reg_mask();
887 }
888 attr->sample_stack_user = param->dump_size;
889 attr->exclude_callchain_user = 1;

--- 2280 unchanged lines hidden ---
884 pr_warning("WARNING: The use of --call-graph=dwarf may require all the user registers, "
885 "specifying a subset with --user-regs may render DWARF unwinding unreliable, "
886 "so the minimal registers set (IP, SP) is explicitly forced.\n");
887 } else {
888 attr->sample_regs_user |= arch__user_reg_mask();
889 }
890 attr->sample_stack_user = param->dump_size;
891 attr->exclude_callchain_user = 1;

--- 2280 unchanged lines hidden ---