Skip to content

Instantly share code, notes, and snippets.

@1ace

1ace/1-build.sh Secret

Created April 12, 2023 16:58
Show Gist options
  • Save 1ace/1b629092f0074b2f20318d60667436e6 to your computer and use it in GitHub Desktop.
Save 1ace/1b629092f0074b2f20318d60667436e6 to your computer and use it in GitHub Desktop.
#!/bin/bash
cc -o foo foo.c -ggdb -O0 #-fno-omit-frame-pointer
#!/bin/bash
perf record -g --call-graph dwarf -- ./foo
#!/bin/bash
perf report -g --stdio --sort=time
#include <stdio.h>
void hello()
{
printf("Hello!\n");
}
int main()
{
for (int i = 0; i < 10; i++)
hello();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment