diff options
author | Eric Sun <jian.sun@freescale.com> | 2012-06-25 19:03:46 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:39:07 +0800 |
commit | 0b67bfedaa8dc7e4b8061efe96e37eba677b22a6 (patch) | |
tree | b01347dbbef0eb1470986c159ffd03d4bd261d89 /arch/arm/plat-mxc | |
parent | c5a4b95c72dfeaf2b04b27f53d8f15b9b3aa8f09 (diff) |
ENGR00214813 MX6DL SabreSD : Kernel, Enable ARM Perfromance Monitor
Register PMU resources during system bootup, so that "Perf" Command can
be used to get misc performance data of a running program
The "Perf" Exe should be built manually in
"./tools/perf" using the following command line
> make CROSS_COMPILER=... ARCH=arm CFLAGS="-static -DGElf_Nhdr=Elf32_Nhdr"
then copy the "Perf" executable to rootfs/bin
Usage :
perf # show help content
perf list # show all available statistics options
perf stat ls # show all statistics of a "ls" command
perf stat -e cycles tar cvfz bin.tgz /bin
# show "cycles" statistics of command
# "tar cvfz ...."
MX6 Series Chips bound all CPUs PERFMON IRQ to one, this may cause some
problems when get per-CPU statistics. Need further investigation
Signed-off-by: Eric Sun <jian.sun@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc')
-rwxr-xr-x | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-pmu.c | 44 | ||||
-rwxr-xr-x | arch/arm/plat-mxc/include/mach/devices-common.h | 2 |
3 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 386b9cb4e29c..41287783cb80 100755 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile @@ -66,3 +66,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_MIPI_DSI) += platform-imx-mipi_dsi.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_MIPI_CSI2) += platform-imx-mipi_csi2.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_VDOA) += platform-imx-vdoa.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_PCIE) += platform-imx-pcie.o +obj-y += platform-imx-pmu.o diff --git a/arch/arm/plat-mxc/devices/platform-imx-pmu.c b/arch/arm/plat-mxc/devices/platform-imx-pmu.c new file mode 100644 index 000000000000..cf29415d679e --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-pmu.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <asm/sizes.h> +#include <mach/hardware.h> +#include <mach/devices-common.h> +#include <asm/pmu.h> + +static struct resource mx6_pmu_resources[] = { + [0] = { + .start = MXC_INT_CHEETAH_PERFORM, + .end = MXC_INT_CHEETAH_PERFORM, + .flags = IORESOURCE_IRQ, + }, +}; + +struct platform_device mx6_pmu_device = { + .name = "arm-pmu", + .id = ARM_PMU_DEVICE_CPU, + .num_resources = ARRAY_SIZE(mx6_pmu_resources), + .resource = mx6_pmu_resources, +}; + +void __init imx_add_imx_armpmu() +{ + platform_device_register(&mx6_pmu_device); +} diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 369ec0f6bd4a..8aa1322e2e11 100755 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h @@ -685,3 +685,5 @@ struct imx_pcie_data { struct platform_device *__init imx_add_pcie( const struct imx_pcie_data *data, const struct imx_pcie_platform_data *pdata); + +void __init imx_add_imx_armpmu(void); |