Oracle trace events hunting : Events annotations/Events Sniffing

Based on my previous blog posts :

I created two files that can help us to quickly extract Events checked in specific oracle core function :

Using those files we can for example :

Example 1 : (Annotated flame-graph) Have an annotated flame graph which can be useful to quickly check which events can be used to dig deeper.

Here is for example two flame-graphs annotated and not annotated after executing select count(*) from dba_objects :

No annotated :


perf record -g -p 2022
perf script | FlameGraph-master/stackcollapse-perf.pl > out.perf-folded
FlameGraph-master/flamegraph.pl out.perf-folded > perf-oracle.svg

Capture 01

Annotated :


perf record -g -p 2022
perf script | FlameGraph-master/stackcollapse-perf.pl > out.perf-folded
cat out.perf-folded | sed -f oracle_function_to_event_mapping18c.sed > out_annotate.perf-folded
FlameGraph-master/flamegraph.pl out_annotate.perf-folded > perf-oracle_annotate.svg

Capture 02

Capture 05

Example 2 :(Event Sniffer) We can also use the debugtrace.so pin tool to extract “all” checked events in specific execution path  : After executing select * from dual for example


./pin -pid 2677 -t source/tools/DebugTrace/obj-intel64/debugtrace.so
grep -i call debugtrace.out | awk -F':' '{print $2}' | awk -F'+' '{print $1}' | egrep -v ">" | sort -u | sed -f oracle_function_to_event_mapping18c.sed | grep EVENT

Capture 03

Example 3 :(Extract Checked event ) Quickly extract checked events in a specific core oracle function :

Capture 04

That’s it 😀

 

One thought on “Oracle trace events hunting : Events annotations/Events Sniffing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s