[PATCH] D114584: [LNT] Fixed JS error caused by selecting the function with missing counters on the profile page

Pavel Kosov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 25 04:56:17 PST 2021


kpdev42 created this revision.
kpdev42 added reviewers: cmatthews, thopre, danilaml.
kpdev42 added a project: LLVM.
Herald added a subscriber: dkolesnichenko.
kpdev42 requested review of this revision.

Some counters may be missing for some functions. These functions are labeled as `no data` on the Profile page.
You will get the JS error `value.toFixed is not a function` after selecting such function and the control flow graph.
This patch fixes this error.

OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg


Repository:
  rLNT LNT

https://reviews.llvm.org/D114584

Files:
  lnt/server/ui/static/lnt_profile.js


Index: lnt/server/ui/static/lnt_profile.js
===================================================================
--- lnt/server/ui/static/lnt_profile.js
+++ lnt/server/ui/static/lnt_profile.js
@@ -20,8 +20,8 @@
     this.noFallThru = gjt[0];
     this.weight = this.instructions
         .reduce(function (a,b) {
-            var weight_a = (a.weight === undefined)?a:a.weight;
-            var weight_b = (b.weight === undefined)?b:b.weight;
+            var weight_a = (a.weight === undefined)?0:a.weight;
+            var weight_b = (b.weight === undefined)?0:b.weight;
             return weight_a+weight_b;
         }, 0);
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114584.389740.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211125/1207ab7a/attachment.bin>


More information about the llvm-commits mailing list