From 323c196b555b718b5bbd19fff0cc82947aa77431 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 28 Jan 2025 10:14:44 +0100 Subject: pkg/coveragedb: add functions table Session aggregates information about multiple builds. The source code may have a few function definitions per file. In case of multiple function definitions we want to see sum(func1 + func2). Instead of [line_from, line_to] it is better to store the specific list of lines signaled func coverage. --- pkg/coveragedb/init_db.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pkg/coveragedb') diff --git a/pkg/coveragedb/init_db.sh b/pkg/coveragedb/init_db.sh index ddf231f98..ef82f35b2 100755 --- a/pkg/coveragedb/init_db.sh +++ b/pkg/coveragedb/init_db.sh @@ -25,6 +25,22 @@ CREATE TABLE gcloud spanner databases ddl update $db --instance=syzbot --project=syzkaller \ --ddl="$create_table" +echo "drop table 'functions' if exists" +gcloud spanner databases ddl update $db --instance=syzbot --project=syzkaller \ +--ddl="DROP TABLE IF EXISTS functions" +echo "create table 'functions'" +create_table=$( echo -n ' +CREATE TABLE + functions ( + "session" text, + "filepath" text, + "function" text, + "lines" bigint[], + PRIMARY KEY + (session, filepath, function) );') +gcloud spanner databases ddl update $db --instance=syzbot --project=syzkaller \ + --ddl="$create_table" + echo "drop table 'merge_history' if exists" gcloud spanner databases ddl update $db --instance=syzbot --project=syzkaller \ --ddl="DROP TABLE IF EXISTS merge_history" -- cgit mrf-deployment