|
|
|
Re: [PATCH 07/13] perf: Add attribute to filter out callchains | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
|
On Wed, Aug 01, 2012 at 02:10:59PM +0400, Jiri Olsa wrote:
> From: Frederic Weisbecker <fweisbec@xxxxxxxxx>
>
> Introducing following bits to the the perf_event_attr struct:
> - exclude_callchain_kernel to filter out kernel callchain
> from the sample dump
> - exclude_callchain_user to filter out user callchain
> from the sample dump
>
> We need to be able to disable standard user callchain dump
> when we use the dwarf cfi callchain mode, because frame
> pointer based user callchains are useless in this mode.
>
> Implementing also exclude_callchain_kernel to have complete
> set of options.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> [ Added kernel callchains filtering ]
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> CC: Andrew Vagin <avagin@xxxxxxxxxx>
Acked-by: Andrew Vagin <avagin@xxxxxxxxxx>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index c4582bb..0902d4a 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -4130,8 +4130,12 @@ void perf_prepare_sample(struct perf_event_header *header,
>
> if (sample_type & PERF_SAMPLE_CALLCHAIN) {
> int size = 1;
> + int kernel = !event->attr.exclude_callchain_kernel;
> + int user = !event->attr.exclude_callchain_user;
>
> - data->callchain = perf_callchain(event, regs);
> + if (kernel || user)
> + data->callchain = perf_callchain(event, regs,
> + kernel, user);
I am not sure, that we need two arguments kernel and user here,
we can get them from event inside perf_callchain...
>
> if (data->callchain)
> size += data->callchain->nr;
> diff --git a/kernel/events/internal.h b/kernel/events/internal.h
> index ce7bdfc..95d0215 100644
> --- a/kernel/events/internal.h
> +++ b/kernel/events/internal.h
> @@ -126,7 +126,8 @@ DEFINE_OUTPUT_COPY(__output_copy_user, arch_perf_out_copy_user)
>
> /* Callchain handling */
> extern struct perf_callchain_entry *
> -perf_callchain(struct perf_event *event, struct pt_regs *regs);
> +perf_callchain(struct perf_event *event, struct pt_regs *regs,
> + int kernel, int user);
> extern int get_callchain_buffers(void);
> extern void put_callchain_buffers(void);
>
> --
> 1.7.7.6
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Other Archives] [Linux Kernel Newbies] [Linux Driver Development] [Linux Kbuild] [Fedora Kernel] [Linux Kernel Testers] [Linux SH] [Linux Omap] [Linux Tape] [Linux Input] [Linux Kernel Janitors] [Linux Kernel Packagers] [Linux Doc] [Linux Man Pages] [Linux API] [Linux Memory Management] [Linux Modules] [Linux Standards] [Kernel Announce] [Netdev] [Git] [Linux PCI] Linux CAN Development [Linux I2C] [Linux RDMA] [Linux NUMA] [Netfilter] [Netfilter Devel] [SELinux] [Bugtraq] [FIO] [Linux Perf Users] [Linux Serial] [Linux PPP] [Linux ISDN] [Linux Next] [Kernel Stable Commits] [Linux Tip Commits] [Kernel MM Commits] [Linux Security Module] [AutoFS] [Filesystem Development] [Ext3 Filesystem] [Linux bcache] [Ext4 Filesystem] [Linux BTRFS] [Linux CEPH Filesystem] [Linux XFS] [XFS] [Linux NFS] [Linux CIFS] [Ecryptfs] [Linux NILFS] [Linux Cachefs] [Reiser FS] [Initramfs] [Linux FB Devel] [Linux OpenGL] [DRI Devel] [Fastboot] [Linux RT Users] [Linux RT Stable] [eCos] [Corosync] [Linux Clusters] [LVS Devel] [Hot Plug] [Linux Virtualization] [KVM] [KVM PPC] [KVM ia64] [Linux Containers] [Linux Hexagon] [Linux Cgroups] [Util Linux] [Wireless] [Linux Bluetooth] [Bluez Devel] [Ethernet Bridging] [Embedded Linux] [Barebox] [Linux MMC] [Linux IIO] [Sparse] [Smatch] [Linux Arch] [x86 Platform Driver] [Linux ACPI] [Linux IBM ACPI] [LM Sensors] [CPU Freq] [Linux Power Management] [Linmodems] [Linux DCCP] [Linux SCTP] [ALSA Devel] [Linux USB] [Linux PA RISC] [Linux Samsung SOC] [MIPS Linux] [IBM S/390 Linux] [ARM Linux] [ARM Kernel] [ARM MSM] [Tegra Devel] [Sparc Linux] [Linux Security] [Linux Sound] [Linux Media] [Video 4 Linux] [Linux IRDA Users] [Linux for the blind] [Linux RAID] [Linux ATA RAID] [Device Mapper] [Linux SCSI] [SCSI Target Devel] [Linux SCSI Target Infrastructure] [Linux IDE] [Linux SMP] [Linux AXP] [Linux Alpha] [Linux M68K] [Linux ia64] [Linux 8086] [Linux x86_64] [Linux Config] [Linux Apps] [Linux MSDOS] [Linux X.25] [Linux Crypto] [DM Crypt] [Linux Trace Users] [Linux Btrace] [Linux Watchdog] [Utrace Devel] [Linux C Programming] [Linux Assembly] [Dash] [DWARVES] [Hail Devel] [Linux Kernel Debugger] [Linux gcc] [Gcc Help] [X.Org] [Wine]
![]() |
![]() |
[Older Kernel Discussion] [Yosemite National Park Forum] [Large Format Photos] [Gimp] [Yosemite Photos] [Stuff]