aboutsummaryrefslogtreecommitdiff
path: root/user_activity_benchmarks/select_hot_functions.sql
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2017-02-08 10:45:48 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-08 10:45:48 +0000
commit9826fbe38e2bc35fc6c680cc216dcb993b54d2ff (patch)
tree87b3a32b13c392939d66fa93105896f5df0736a6 /user_activity_benchmarks/select_hot_functions.sql
parentbaba90fd78c18585d22430dc95c748f96ad0c772 (diff)
parent271389dd3199539c4474c351942f4d4fa975b81b (diff)
downloadtoolchain-utils-9826fbe38e2bc35fc6c680cc216dcb993b54d2ff.tar.gz
Merge remote-tracking branch 'aosp/mirror-chromium-master' into initial_import am: 870a8df6fc am: 9c6fa5f9e5 am: c5804ce784
am: 271389dd31 Change-Id: I22e657bc86117da9a6a45329a67a21096736da03
Diffstat (limited to 'user_activity_benchmarks/select_hot_functions.sql')
-rw-r--r--user_activity_benchmarks/select_hot_functions.sql27
1 files changed, 27 insertions, 0 deletions
diff --git a/user_activity_benchmarks/select_hot_functions.sql b/user_activity_benchmarks/select_hot_functions.sql
new file mode 100644
index 00000000..d121d619
--- /dev/null
+++ b/user_activity_benchmarks/select_hot_functions.sql
@@ -0,0 +1,27 @@
+-- Collects the function, with its file, the object and inclusive count value.
+-- The limits here are entirely arbitrary.
+-- For more background, look at
+-- https://sites.google.com/a/google.com/cwp/about/callgraphs.
+SELECT
+ frame.function_name AS function,
+ frame.filename AS file,
+ frame.load_module_path AS dso,
+ sum(frame.inclusive_count) AS inclusive_count
+FROM
+ -- Collect the data stored in CWP over the last 30 days.
+ FLATTEN(chromeos_wide_profiling.sampledb.cycles.callgraph.last30days, frame)
+WHERE
+ meta.cros.report_id % UINT64("1") == 0
+ -- The reports were collected periodically.
+ AND meta.cros.collection_info.trigger_event == 1
+ AND `profile.duration_usec` < 2100000
+ -- The reports were from a busy machine.
+ AND session.total_count > 2000
+ -- The reports are from the gnawty board, x86_64 architecture.
+ AND meta.cros.board == "gnawty"
+ AND meta.cros.cpu_architecture == "x86_64"
+ -- The reports include callchain data.
+ AND left(meta.cros.version, 4) > "6970"
+ GROUP BY function, dso, file
+ORDER BY `inclusive_count` DESC
+LIMIT 50000 ;