Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d61dd7d authored by Zhigang Lu's avatar Zhigang Lu Committed by Chris Metcalf
Browse files

tile/perf: Support perf_events on tilegx and tilepro



Add perf support for tile architecture.

Signed-off-by: default avatarZhigang Lu <zlu@tilera.com>
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent ba678231
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@

config TILE
	def_bool y
	select HAVE_PERF_EVENTS
	select USE_PMC if PERF_EVENTS
	select HAVE_DMA_ATTRS
	select HAVE_DMA_API_DEBUG
	select HAVE_KVM if !TILEGX
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright 2014 Tilera Corporation. 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, version 2.
 *
 *   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, GOOD TITLE or
 *   NON INFRINGEMENT.  See the GNU General Public License for
 *   more details.
 */

#ifndef _ASM_TILE_PERF_EVENT_H
#define _ASM_TILE_PERF_EVENT_H

#include <linux/percpu.h>
DECLARE_PER_CPU(u64, perf_irqs);

unsigned long handle_syscall_link_address(void);
#endif /* _ASM_TILE_PERF_EVENT_H */
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ obj-$(CONFIG_PCI) += pci_gx.o
else
obj-$(CONFIG_PCI)		+= pci.o
endif
obj-$(CONFIG_PERF_EVENTS)	+= perf_event.o
obj-$(CONFIG_USE_PMC)		+= pmc.o
obj-$(CONFIG_TILE_USB)		+= usb.o
obj-$(CONFIG_TILE_HVGLUE_TRACE)	+= hvglue_trace.o
+18 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <hv/drv_pcie_rc_intf.h>
#include <arch/spr_def.h>
#include <asm/traps.h>
#include <linux/perf_event.h>

/* Bit-flag stored in irq_desc->chip_data to indicate HW-cleared irqs. */
#define IS_HW_CLEARED 1
@@ -260,6 +261,23 @@ void ack_bad_irq(unsigned int irq)
	pr_err("unexpected IRQ trap at vector %02x\n", irq);
}

/*
 * /proc/interrupts printing:
 */
int arch_show_interrupts(struct seq_file *p, int prec)
{
#ifdef CONFIG_PERF_EVENTS
	int i;

	seq_printf(p, "%*s: ", prec, "PMI");

	for_each_online_cpu(i)
		seq_printf(p, "%10llu ", per_cpu(perf_irqs, i));
	seq_puts(p, "  perf_events\n");
#endif
	return 0;
}

/*
 * Generic, controller-independent functions:
 */
+1005 −0

File added.

Preview size limit exceeded, changes collapsed.