Re: oprofile support for PPC_E5500

Michael Petlan <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <alpine.LRH.2.20.1607071634370.10992@Diego>
Hi,

could you please test the attached patch?

E6500 also has the same PMU events as E500mc plus some more.
It would be good to know what the set of events supported by
the E5500 actually is.

Please run the oprofile-tests testsuite and the attached test
and send the logs from the second one?

Anyway, it would be nice if someone more appropriate reviewed
the events and checks the kernel support, etc.

Thanks.
Michael


On Wed, 6 Jul 2016, Beaman, Thomas wrote:
> When I am running on my PPC E5500 system oprofile cannot detect the CPU
> 
>  
> 
> operf --version
> 
> Unable to obtain cpu_type
> 
>  
> 
> Looking at op_cpu_type.h I see entries for
> 
>  
> 
>                 CPU_PPC_E500MC, /**< e500mc */
> 
>                 CPU_PPC_E6500, /**< e6500 */
> 
>  
> 
> But no entry for the PPC E5500.  The E5500 is very similar to e500mc and the E6500.  Can support be added for this processor ?
> 
>  
> 
> Thanks,
> 
> Tom
> 
>  
> 
>  
> 
> 
>

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
ppc-e5500.patch (text/plain, 2.4 KB)
diff --git a/events/ppc/e5500/events b/events/ppc/e5500/events
new file mode 100644
index 0000000..d9e9bea
--- /dev/null
+++ b/events/ppc/e5500/events
@@ -0,0 +1,5 @@
+# e5500 Events
+#
+# Copyright (C) 2012 Freescale Semiconductor, Inc.
+#
+include:ppc/e6500
diff --git a/events/ppc/e5500/unit_masks b/events/ppc/e5500/unit_masks
new file mode 100644
index 0000000..b203ed7
--- /dev/null
+++ b/events/ppc/e5500/unit_masks
@@ -0,0 +1,3 @@
+# e5500 possible unit masks
+#
+include:ppc/6500
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
index 7bdde53..4afe09f 100644
--- a/libop/op_cpu_type.c
+++ b/libop/op_cpu_type.c
@@ -114,6 +114,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = {
 	{ "IBM Power Architected Events V1", "ppc64/architected_events_v1", CPU_PPC64_ARCH_V1, 6 },
 	{ "ppc64 POWER8", "ppc64/power8", CPU_PPC64_POWER8, 6 },
 	{ "e500mc", "ppc/e500mc", CPU_PPC_E500MC, 4 },
+	{ "e5500", "ppc/e5500", CPU_PPC_E5500, 6 },
 	{ "e6500", "ppc/e6500", CPU_PPC_E6500, 6 },
 	{ "Intel Silvermont microarchitecture", "i386/silvermont", CPU_SILVERMONT, 2 },
 	{ "ARMv7 Krait", "arm/armv7-krait", CPU_ARM_KRAIT, 5 },
diff --git a/libop/op_cpu_type.h b/libop/op_cpu_type.h
index 98289c5..9ed4b07 100644
--- a/libop/op_cpu_type.h
+++ b/libop/op_cpu_type.h
@@ -94,6 +94,7 @@ typedef enum {
 	CPU_PPC64_ARCH_V1, /** < IBM Power architected events version 1 */
 	CPU_PPC64_POWER8, /**< ppc64 POWER8 family */
 	CPU_PPC_E500MC, /**< e500mc */
+	CPU_PPC_E5500, /**< e5500 */
 	CPU_PPC_E6500, /**< e6500 */
 	CPU_SILVERMONT, /** < Intel Silvermont microarchitecture */
 	CPU_ARM_KRAIT, /**< ARM KRAIT */
diff --git a/libop/op_events.c b/libop/op_events.c
index cdd0409..9f5e876 100644
--- a/libop/op_events.c
+++ b/libop/op_events.c
@@ -1299,6 +1299,7 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
 		case CPU_PPC_E500:
 		case CPU_PPC_E500_2:
 		case CPU_PPC_E500MC:
+		case CPU_PPC_E5500:
 		case CPU_PPC_E6500:
 		case CPU_PPC_E300:
 			descr->name = "CPU_CLK";
diff --git a/utils/ophelp.c b/utils/ophelp.c
index 5821593..f0052d5 100644
--- a/utils/ophelp.c
+++ b/utils/ophelp.c
@@ -745,6 +745,7 @@ int main(int argc, char const * argv[])
 	case CPU_PPC_E500:
 	case CPU_PPC_E500_2:
 	case CPU_PPC_E500MC:
+	case CPU_PPC_E5500:
 	case CPU_PPC_E6500:
 		event_doc =
 			"See PowerPC e500 Core Complex Reference Manual\n"
check_events.sh (application/x-sh, 699 B)
#!/bin/bash

SUPPORTED_LIST="supported.list"
UNSUPPORTED_LIST="unsupported.list"
ALL_LIST="events.list"
LOGFILE="results.log"
CMD="sleep 0.2"

test -e $SUPPORTED_LIST && rm -f $SUPPORTED_LIST
test -e $UNSUPPORTED_LIST && rm -f $UNSUPPORTED_LIST && touch $UNSUPPORTED_LIST
test -e $LOGFILE && rm -f $LOGFILE

# get the events
ophelp -X | perl -ne 'print "$1\n" if /event_name=\"(\w+)\"/' > $ALL_LIST

# check the events
for evt in `cat $ALL_LIST`; do
	ocount -b -e $evt $CMD >> $LOGFILE
	if [ $? -ne 0 ]; then
		echo "$evt" >> $UNSUPPORTED_LIST
	else
		echo "$evt" >> $SUPPORTED_LIST
	fi
done

cat $LOGFILE | egrep -v '^$' > $LOGFILE.tmp
mv $LOGFILE.tmp $LOGFILE

! test -s $UNSUPPORTED_LIST
exit $?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.