This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

coverage database support


Hi all,

I have been working on incorporating a database to track what parts of
systemtap tapsets are exercised by the testsuite. Comments and
feedback on it would be appreciated. Preliminary support for this
(pr4529) has been checked into the systemtap cvs repository. It makes
use of sqlite3 to store the data base information.  There are two
possible ways of activating the coverage: using '-q' option on command
line and setting environment variable SYSTEMTAP_COVERAGE.

The database is persistent and additional runs will add to the
database.  The resulting data is stored in a very simple database
located in SYSTEMTAP_DIR/`uname -r`.db. This can be further analyzed
using sqlite3 and some simple scripts. It is also possible to have
other programs navigate the database in a cscope style, but notheing
has been implemented to do that currently.

The structure of the data base is very simple flat table. Some work
needs to be done to make the encoding more compact and accesses
faster. The table counts is formated in the following

table counts (
/* token location information */
	file text,	
	line integer,
	col integer,

        type text,	/* 'p' probe, 'f' function, 'l' local, 'g' global */
	name text,	/* name of item */
	parent text,	/* name of probe or function local is in */
        compiled integer, /* ==0 no c code generated, >0 c code generated */
	removed integer, /* >0 parsed */
	executed integer /* >0 code executed, not implemented */
);


Get some data into the database running the recently built systemtap with coverage support:

../install/bin/stap -v -q -p2 -mx ../src/testsuite/systemtap.samples/poll_map.stp

Start up sqlite3 with:

sqlite3 ~/.systemtap/2.6.20-1.2962.fc6.db

Print out the functions compiled:

sqlite> select * from counts where (type='f' and compiled>'0');
/home/wcohen/research/profiling/systemtap_write/install/share/systemtap/tapset/context.stp|31|10|f|execname||1|0|0
/home/wcohen/research/profiling/systemtap_write/install/share/systemtap/tapset/logging.stp|19|10|f|exit||1|0|0

Print out the used probes:

sqlite> select * from counts where (type='p' and compiled>'0');
../src/testsuite/systemtap.samples/poll_map.stp|8|7|p|kernel.function("sys_execve@arch/x86_64/kernel/process.c:677").call||316|0|0
../src/testsuite/systemtap.samples/poll_map.stp|12|7|p|timer.ms(1000)||4|0|0
../src/testsuite/systemtap.samples/poll_map.stp|28|7|p|end||2|0|0

Print out the unused functions with:

select * from counts where (type='f' and compiled='0');


Current issues with the coverage support:


-slow, testsuite/semok/twenty.stp takes hours to run because it generates
	so many entries.

-missing entries for unused aliases.

-no execute data, would be really nice to know what probes have
actually been used and record them in the database

-redering to provide information in a manner similar to:
 http://people.redhat.com/wcohen/stap-combined-tests-200705240830/


-Will



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]