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

arc: Mix fixes in tracing view.

This fixes:
   tooltip position in case content is scrolled.
   average power computation.
   allows digits in normalized names.

TEST=Locally
BUG=b/143532713

Change-Id: I25f7976f2cb9832d05a93f2bea1d2590ba454516
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899894Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712817}
parent e856a5ac
......@@ -179,9 +179,10 @@ function getAveragePower(model, eventType) {
var lastTimestamp = 0;
var totalEnergy = 0;
var index = events.getFirstEvent();
while (index > 0) {
while (index >= 0) {
var timestamp = events.events[index][1];
totalEnergy = events.events[index][2] * (timestamp - lastTimestamp);
totalEnergy +=
events.events[index][2] * (timestamp - lastTimestamp) * 0.001;
lastTimestamp = timestamp;
index = events.getNextEvent(index, 1 /* direction */);
}
......
......@@ -1222,8 +1222,8 @@ class EventBands {
showTooltipForEvent_(event, svg, height, width) {
svg.setAttribute('height', height + 'px');
svg.setAttribute('width', width + 'px');
this.tooltip.style.left = event.clientX + 'px';
this.tooltip.style.top = event.clientY + 'px';
this.tooltip.style.left = event.pageX + 'px';
this.tooltip.style.top = event.pageY + 'px';
this.tooltip.style.height = height + 'px';
this.tooltip.style.width = width + 'px';
this.tooltip.classList.add('active');
......
......@@ -88,7 +88,7 @@ base::FilePath GetModelPathFromTitle(Profile* profile,
normalized_name[index++] = '_';
continue;
}
if (c >= 'a' && c <= 'z')
if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))
normalized_name[index++] = c;
}
normalized_name[index] = 0;
......
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