Tags » Tracing

Mining SQL Trace Files Using External Tables Part 2: Resource Profiling

Extending the timeline

Last time in Mining SQL Trace Files Using External Tables Part 1: Getting the Timeline, we saw how to extract essential information from a 10046 trace file and establish the order in which SQL statements are issued. 2,156 more words

Oracle

Mining SQL Trace Files Using External Tables Part 1: Getting the Timeline

Why external tables?

SQL trace files and external tables – at first glance, you wouldn’t think they’re a good match (or so I guess).
Given their structure, SQL trace files seem best suited for being processed serially, line by line, by a procedural or functional programming language. 2,199 more words

Oracle

Road trip - For the journey...Temporary studio's of growth and grace

My wife returned from a gig night with a difference; she had one of those moments I had mentioned in my last blog. The lead singer spoke in the middle of her set about what she had desired to do before finding a passion for singing. 1,680 more words

Spirituality

Brain Breadcrumbs

It’s not very often I put this much planning into an artwork. This one is quite the exception and the planning stage is laborious and intense. 196 more words

Art

Howto trace/profile C function calls in Linux (using gcc, strace, systemtap, sysdig, ktap, lttng)

'-finstrument-functions'
  void __cyg_profile_func_enter (void *this_fn, void *call_site);
  void __cyg_profile_func_exit  (void *this_fn, void *call_site);

$ cat trace.c
#include <stdio.h>
#include <time.h>
static FILE *fp_trace;
/* GCC's constructor/destructor attributes define functions executed before/after main */
void __attribute__ ((constructor)) trace_begin (void) { fp_trace = fopen("trace.out", "w"); }
void __attribute__ ((destructor)) trace_end (void) { if(fp_trace != NULL) fclose(fp_trace); }
/* GCC's instrument-functions */
void __cyg_profile_func_enter (void *func,  void *caller) { 
    if(fp_trace != NULL) fprintf(fp_trace, "e %p %p %lun", func, caller, time(NULL) );
}
void __cyg_profile_func_exit (void *func, void *caller) {
    if(fp_trace != NULL) fprintf(fp_trace, "x %p %p %lun", func, caller, time(NULL));
}

$ gcc -finstrument-functions -g -c -o main.o main.c
$ gcc -c -o trace.o trace.c
$ gcc main.o trace.o -o main
$ ./main
foo
$ cat trace.out
e 0x400679 0x394281c40b 1286372153
e 0x400648 0x40069a 1286372153
(use 'addr2line' to map execution address to source file and line)
… 1,395 more words

Ever-Changing Mood

I hear the wind blowing. It’s blowing quite heavily at the moment. I considered sweeping leaves up in the driveway this afternoon, because trash pickup is tomorrow and I never finished from last time (weeks ago). 1,663 more words

Other