Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][dataflow] Display line numbers in the HTML logger timeline. #80130

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

martinboehme
Copy link
Contributor

@martinboehme martinboehme commented Jan 31, 2024

This makes it easier to count how many iterations an analysis takes to complete.
It also makes it easier to compare how a change to the analysis code affects
the timeline.

Here's a sample screenshot:

image

This makes it easier to count how many iterations an analysis takes to complete.
It also makes it easier to compare how a change to the analysis code affects
the timeline.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html clang:analysis labels Jan 31, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 31, 2024

@llvm/pr-subscribers-clang-analysis

@llvm/pr-subscribers-clang

Author: None (martinboehme)

Changes

This makes it easier to count how many iterations an analysis takes to complete.
It also makes it easier to compare how a change to the analysis code affects
the timeline.


Full diff: https://github.com/llvm/llvm-project/pull/80130.diff

2 Files Affected:

  • (modified) clang/lib/Analysis/FlowSensitive/HTMLLogger.css (+10)
  • (modified) clang/lib/Analysis/FlowSensitive/HTMLLogger.html (+1)
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
index 5da8db8fa87bf..e25270430efc2 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
@@ -29,6 +29,16 @@ section h2 {
 }
 #timeline {
   min-width: max-content;
+  counter-reset: entry_counter;
+}
+#timeline .entry .counter::before {
+  counter-increment: entry_counter;
+  content: counter(entry_counter) ":";
+}
+#timeline .entry .counter {
+  display: inline-block;
+  min-width: 2em; /* Enough space for two digits and a colon */
+  text-align: right;
 }
 #timeline .entry.hover {
   background-color: #aaa;
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
index b9f76c5074c75..be173e8b2854d 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -42,6 +42,7 @@
 <header>Timeline</header>
 <template data-for="entry in timeline">
   <div id="{{entry.block}}:{{entry.iter}}" data-bb="{{entry.block}}" class="entry">
+    <span class="counter"></span>
     {{entry.block}}
     <template data-if="entry.post_visit">(post-visit)</template>
     <template data-if="!entry.post_visit">({{entry.iter}})</template>

@martinboehme
Copy link
Contributor Author

Failing check is a clang-format check for clang/docs/HIPSupport.rst, which this PR does not modify.

@martinboehme martinboehme merged commit 0c36127 into llvm:main Feb 1, 2024
6 of 7 checks passed
carlosgalvezp pushed a commit to carlosgalvezp/llvm-project that referenced this pull request Feb 1, 2024
…lvm#80130)

This makes it easier to count how many iterations an analysis takes to
complete.
It also makes it easier to compare how a change to the analysis code
affects
the timeline.

Here's a sample screenshot:


![image](https://github.com/llvm/llvm-project/assets/29098113/b3f44b4d-7037-4f28-9532-5418663250e1)
agozillon pushed a commit to agozillon/llvm-project that referenced this pull request Feb 5, 2024
…lvm#80130)

This makes it easier to count how many iterations an analysis takes to
complete.
It also makes it easier to compare how a change to the analysis code
affects
the timeline.

Here's a sample screenshot:


![image](https://github.com/llvm/llvm-project/assets/29098113/b3f44b4d-7037-4f28-9532-5418663250e1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:analysis clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants