8 if (!defined($warns)) {
9 print "usage: $0 <warns.txt>\n";
13 my $db = DBI
->connect("dbi:SQLite:smatch_db.sqlite", "", "", {RaiseError
=> 1, AutoCommit
=> 0});
14 $db->do("PRAGMA synchronous = OFF");
15 $db->do("PRAGMA cache_size = 800000");
17 $db->do("delete from function_ptr;");
19 open(WARNS
, "<$warns");
21 if (!($_ =~ /info: sets_fn_ptr /)) {
25 # kernel/ksysfs.c +87 (null)(87) info: sets_fn_ptr '(struct kobj_attribute)->show' 'profiling_show'
29 my ($file_and_line, $file, $dummy, $struct_bit, $func, $ptr);
30 ($file_and_line, $dummy, $dummy, $dummy, $struct_bit, $ptr, $func) = split(/ /, $_);
31 ($file, $dummy) = split(/:/, $file_and_line);
33 if (!defined($func)) {
36 if (!($struct_bit =~ /^'\(struct$/)) {
39 if (!($func =~ /^'[\w_]+'$/)) {
47 $db->do("insert into function_ptr values ('$file', '$func', '$struct_bit $ptr')\n");