Example #1
0
int main()
{
    sleep(30);
    STAP_PROBE(proc_by_pid, main_start);
    marker_here:
      first_function();
    STAP_PROBE(proc_by_pid, main_end);
    second_function();
    exit_probe_function();
    return 0;
}
Example #2
0
inline int ilibloopfunc (void) {
  int i, j = 0;
  STAP_PROBE(_test_, ilibloopfunc_enter);
  for (i = 0; i < 10; ++i)
    j += i;
  (void) malloc(100); /* trigger some plt activity */
  return j;
}
Example #3
0
void
t1 (int i)
{
  srandom (i);
  i = 6;
  srandom (i);
  STAP_PROBE(test, t1);
  srandom (i + 4);
}
Example #4
0
void
t3 (unsigned long long i)
{
  srandom (i);
  i = 0xdeadbeef87654321LL;
  srandom (i);
  STAP_PROBE(test, t3);
  srandom (i + 4);
}
Example #5
0
void
t2 (unsigned int i)
{
  srandom (i);
  i = 0xdeadbeef;
  srandom (i);
  STAP_PROBE(test, t2);
  srandom (i + 4);
}
Example #6
0
int libloopfunc (void) {
  int i, j = 0;
  if (0) goto a;
 a:
  STAP_PROBE(_test_, libloopfunc_enter);
  for (i = 0; i < 10; ++i)
    j += ilibloopfunc ();
  return j;
}
Example #7
0
/* We need an inline function. */
inline void __attribute__ ((always_inline)) ibar (void) {
/* We need a threaded app. */
  void *x;
  STAP_PROBE(_test_, main_enter);
  pthread_t thread;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_create (& thread, & attr, bar, 0);
  pthread_join (thread, & x);
}
Example #8
0
/* We need a threaded app.  It should not be inline,
   so a .callee("tbar") test will require the GNU_call_site* DWARF goo
   to match, not just the presence of a mere DW_AT_inline=3 case. */
int tbar (void) {
  void *x;
  int j = 0;
  STAP_PROBE(_test_, main_enter);
  pthread_t thread;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_create (& thread, & attr, bar, (void*)& j);
  pthread_join (thread, & x);
  return j;
}
Example #9
0
int
t3 (unsigned long long i)
{
  int a[] = { 17, 23 };
  struct cull c;
  c.i = i;
  srandom (c.i);
  i = 0xdeadbeef87654321LL;
  c.i = i;
  srandom (c.i);
  STAP_PROBE(test, t3);
  c.i = i;
  srandom (c.i + 4);
  return a[0] + a[1];
}
Example #10
0
int
t2 (unsigned int i)
{
  int a[] = { 17, 23 };
  struct cui c;
  c.i = i;
  srandom (c.i);
  i = 0xdeadbeef;
  c.i = i;
  srandom (c.i);
  STAP_PROBE(test, t2);
  c.i = i;
  srandom (c.i + 4);
  return a[0] + a[1];
}
Example #11
0
int
t1 (int i)
{
  int a[] = { 17, 23 };
  struct ci c;
  c.i = i;
  srandom (c.i);
  i = 6;
  c.i = i;
  srandom (c.i);
  STAP_PROBE(test, t1);
  c.i = i;
  srandom (c.i + 4);
  return a[0] + a[1];
}
Example #12
0
void libfoofunc (void) {
  STAP_PROBE(_test_, libfoofunc_enter);
  if (0) goto a;
 a:
  ilibfoofunc ();
}
Example #13
0
inline void ilibfoofunc (void) {
  STAP_PROBE(_test_, ilibfoofunc_enter);
}
Example #14
0
static void
m2 (void)
{
  if (TEST2)
    STAP_PROBE (test, two);
}