RE: oprofile support for PPC_E5500

Michael Petlan <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <alpine.LRH.2.20.1607131617420.10992@Diego>
I have forgot the cache-stressing sample program.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
cache_stressing.c (text/plain, 971 B)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

// conversion kB --> B
#define MULTIPLIER 1024
#define KOEF 32
#define OPS 100000

int main(int argc, char **argv)
{
	unsigned long size, i, ofs1, ofs2;
	char *ptr;

	if(argc != 2)
	{
		fprintf(stderr, "Usage %s X\n\twhere X is the size of your cache\n", argv[0]);
		return 1;
	}

	size = atoi(argv[1]) * MULTIPLIER * KOEF;
	ptr = malloc(size * sizeof(char));
	printf("Allocated %i bytes from addr %p\n", size, ptr);
	
	srand(time(NULL));
	
	printf("Doing %i memory operations.\n", OPS);
	for(i = 0; i < OPS; i++)
	{
		ofs1 = rand() % (size / 2);
		if(ofs1 < size / 2)
			ofs2 = ofs1 + (size / 2);
		else
			ofs2 = ofs1 - (size / 2);
		
//		printf("Trying to write from %p to %p (should be between %p and %p)\n", ptr + ofs1, ptr + ofs2, ptr, ptr + size);
		*(ptr + ofs2) &= *(ptr + ofs1);
	}	
	printf("Finished %i memory operations.\n", OPS);
	free(ptr);
	
	return 0;
}
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.