Commit bb960575 authored by khmel@chromium.org's avatar khmel@chromium.org Committed by Commit Bot

arc: Add GPU freq to overview tracing view.

As described.

TEST=Locally
BUG=b/143532713

Change-Id: I601d43bc1d7d0f1eb061674b9b1537f990e3f6f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900166Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712807}
parent 73e55d76
...@@ -304,9 +304,7 @@ function addCPUFrequencyView(parent, resolution, duration) { ...@@ -304,9 +304,7 @@ function addCPUFrequencyView(parent, resolution, duration) {
var attributes = Object.assign({}, attributesTemplate); var attributes = Object.assign({}, attributesTemplate);
attributes.color = modelColors.get(models[i]); attributes.color = modelColors.get(models[i]);
bands.addChartSources( bands.addChartSources(
[new Events( [new Events(models[i].system.memory, 9 /* kCpuFrequency */)],
models[i].system.memory, 9 /* kCpuTemperature */,
9 /* kCpuFrequency */)],
true /* smooth */, attributes); true /* smooth */, attributes);
} }
} }
...@@ -332,13 +330,37 @@ function addCPUTempView(parent, resolution, duration) { ...@@ -332,13 +330,37 @@ function addCPUTempView(parent, resolution, duration) {
var attributes = Object.assign({}, attributesTemplate); var attributes = Object.assign({}, attributesTemplate);
attributes.color = modelColors.get(models[i]); attributes.color = modelColors.get(models[i]);
bands.addChartSources( bands.addChartSources(
[new Events( [new Events(models[i].system.memory, 8 /* kCpuTemperature */)],
models[i].system.memory, 8 /* kCpuTemperature */,
8 /* kCpuTemperature */)],
true /* smooth */, attributes); true /* smooth */, attributes);
} }
} }
/**
* Creates view that shows GPU frequency.
*
* @param {HTMLElement} parent container for the newly created view.
* @param {number} resolution scale of the chart in microseconds per pixel.
* @param {number} duration length of the chart in microseconds.
*/
function addGPUFrequencyView(parent, resolution, duration) {
// Range from 300MHz to 1GHz
// 14MHz 1 pixel resolution
var bands = createChart(
parent, 'GPU Frequency' /* title */, resolution, duration,
50 /* height */, 4 /* gridLinesCount */);
var attributesTemplate =
Object.assign({}, valueAttributes[7 /* kGpuFrequency */]);
attributesTemplate.minValue = 300; // Mhz
attributesTemplate.maxValue = 1000; // Mhz
for (i = 0; i < models.length; i++) {
var attributes = Object.assign({}, attributesTemplate);
attributes.color = modelColors.get(models[i]);
bands.addChartSources(
[new Events(models[i].system.memory, 7 /* kGpuFrequency */)],
false /* smooth */, attributes);
}
}
/** /**
* Creates view that shows FPS change for app commits or swaps for Chrome * Creates view that shows FPS change for app commits or swaps for Chrome
* updates. * updates.
...@@ -463,6 +485,7 @@ function refreshModels() { ...@@ -463,6 +485,7 @@ function refreshModels() {
addCPUFrequencyView(parent, resolution, duration); addCPUFrequencyView(parent, resolution, duration);
addCPUTempView(parent, resolution, duration); addCPUTempView(parent, resolution, duration);
addGPUFrequencyView(parent, resolution, duration);
addFPSView(parent, resolution, duration, true /* appView */); addFPSView(parent, resolution, duration, true /* appView */);
addDeltaView(parent, resolution, duration, true /* appView */); addDeltaView(parent, resolution, duration, true /* appView */);
addFPSView(parent, resolution, duration, false /* appView */); addFPSView(parent, resolution, duration, false /* appView */);
......
...@@ -286,6 +286,8 @@ base::trace_event::TraceConfig GetTracingConfig(ArcGraphicsTracingMode mode) { ...@@ -286,6 +286,8 @@ base::trace_event::TraceConfig GetTracingConfig(ArcGraphicsTracingMode mode) {
case ArcGraphicsTracingMode::kOverview: { case ArcGraphicsTracingMode::kOverview: {
base::trace_event::TraceConfig config( base::trace_event::TraceConfig config(
"-*,exo,viz,toplevel,gpu", base::trace_event::RECORD_CONTINUOUSLY); "-*,exo,viz,toplevel,gpu", base::trace_event::RECORD_CONTINUOUSLY);
config.EnableSystrace();
config.EnableSystraceEvent("i915:intel_gpu_freq_change");
return config; return config;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment