Demo entry 6729480

test

   

Submitted by anonymous on Apr 02, 2018 at 23:15
Language: C. Code size: 459 Bytes.

ldFd=perf_event_open(&aLd,0,-1,-1,0);
stFd=perf_event_open(&aSt,0,-1,ldFd,0);

ringBuf=mmap(NULL,MAPSIZE,PROT_READ
       |PROT_WRITE,MAP_SHARED,ldFd,0);
			 
auxBuf=mmap(NULL,2*AUXSIZE,PROT_READ
   |PROT_WRITE,MAP_SHARED,ldFd,MAPSIZE);

fcntl(ldFd,F_SETFL,O_NONBLOCK|O_ASYNC);

ioctl(stFd,PERF_EVENT_IOC_SET_OUTPUT,ldFd);

fcntl(ldFd,F_SETOWN_EX,&owner);
fcntl(stFd,F_SETOWN_EX,&owner);
fcntl(ldFd,F_SETSIG,SIGIO);
fcntl(stFd,F_SETSIG,SIGIO);

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).