mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Tiny binary.
This commit is contained in:
parent
6f5dd44f1f
commit
9de2d312a3
3
extra/systrace/build
Normal file
3
extra/systrace/build
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
clang tracy_systrace.c -s -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-stack-protector -Wl,-z,norelro -Wl,--build-id=none -nostdlib -lc
|
||||||
|
strip --strip-all -R .note.gnu.gold-version -R .comment -R .note -R .note.gnu.build-id -R .note.ABI-tag -R .eh_frame -R .eh_frame_hdr -R .gnu.hash -R .gnu.version -R .got a.out
|
||||||
|
sstrip -z a.out (elfkickers)
|
@ -3,17 +3,18 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
enum { BufSize = 64*1024 };
|
enum { BufSize = 64*1024 };
|
||||||
|
|
||||||
int main()
|
void _start()
|
||||||
{
|
{
|
||||||
char buf[BufSize];
|
char buf[BufSize];
|
||||||
|
|
||||||
int kernelFd = open( "/sys/kernel/debug/tracing/trace_pipe", O_RDONLY );
|
int kernelFd = open( "/sys/kernel/debug/tracing/trace_pipe", O_RDONLY );
|
||||||
if( kernelFd == -1 ) return -1;
|
if( kernelFd < 0 ) exit( 0 );
|
||||||
|
|
||||||
struct pollfd pfd;
|
struct pollfd pfd;
|
||||||
pfd.fd = kernelFd;
|
pfd.fd = kernelFd;
|
||||||
@ -31,6 +32,5 @@ int main()
|
|||||||
write( STDOUT_FILENO, buf, rd );
|
write( STDOUT_FILENO, buf, rd );
|
||||||
}
|
}
|
||||||
|
|
||||||
close( kernelFd );
|
exit( 0 );
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user