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

Contribute DebugCounter documentation #340

Merged
merged 1 commit into from
Nov 4, 2016

Conversation

amankumar1
Copy link
Contributor

Contribute compiler/ras/DebugCounter.md.

Documenation constains information about using debug counters,
different types of debug counters, naming schemes, and
specifying output.

Signed-off-by: Aman Kumar [email protected]

@@ -0,0 +1,126 @@
# Debug Counter

A debug counter is a facility for adding instrumentation to jitted code to count arbitrary things.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also an incStaticDebugCounter which can be used to count things at compile-time. Perhaps a better introduction would be to say debug counters are a general infrastructure for counting things. There are two flavours - static and dynamic. Static counters do not add anything to the code generated by the compiler, but server to count events at compile-time while dynamic counters are incremented at runtime and are used to count events in code generated by the compiler.


## Naming Scheme

The name of a counter can affect its behaviour, and its relationship with other counters. Special characters in a counter name signal the debug counter facility to treat a counter in a special way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name does not affect the counter behaviour - it modifies the display processing logic for counters which affects how the results are shown to the user - the raw counter will continue to bump in the same way.

```
export TR_DebugCounterFileName=debugcounters.txt
```
Setting the option to `debugCounters={*}` will output all dynamic debug counters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a useful thing in general due to the nature of debug counters and is probably not worth documenting.

@amankumar1 amankumar1 force-pushed the DebugCounterDoc branch 2 times, most recently from b76d0b0 to da187fa Compare October 17, 2016 19:02
@amankumar1
Copy link
Contributor Author

@andrewcraik Documentation updated.

@andrewcraik
Copy link
Contributor

Thanks for accommodating those changes. To round out the documentation it also should discuss incStaticDebugCounter which creates a static debug counter without a dynamic counterpart. These are used quite a bit in the optimizer to count compile events that we do not need or cannot count at runtime. That is to say static only counters can and do exist, dynamic counters get static counterparts by default since knowing the ratio of the number of counters inserted vs the number of counter bumps observed at runtime is a generally useful thing for a dynamic counter.

@vijaysun-omr
Copy link
Contributor

Do you think having example usage(s) shown in the documentation would be useful ? It might serve as a quick reminder on what the syntax is, rather than have to read the full documentation.

@vijaysun-omr vijaysun-omr self-assigned this Nov 1, 2016
@andrewcraik
Copy link
Contributor

Yes - perhaps having a 'Quick Summary' section with example syntax and the full documentation below might help and addition to the incStaticDebugCounter notes.

@amankumar1 amankumar1 force-pushed the DebugCounterDoc branch 4 times, most recently from bb77706 to dda84dc Compare November 4, 2016 17:47
@amankumar1
Copy link
Contributor Author

@vijaysun-omr @andrewcraik Added example syntax and made some other minor changes and additions.

@vijaysun-omr
Copy link
Contributor

One more small request : please added the -Xjit command lines one would need to use for the examples you showed. Thanks.

Contribute compiler/ras/DebugCounter.md.

Documenation constains information about using debug counters,
different types of debug counters, naming schemes, and
specifying output.

[ci skip] Documentation

Signed-off-by: Aman Kumar <[email protected]>
@amankumar1
Copy link
Contributor Author

@vijaysun-omr Added the command line options for the examples.

@vijaysun-omr
Copy link
Contributor

Looks good. Thanks Aman.

@vijaysun-omr vijaysun-omr merged commit c2e97d6 into eclipse-omr:master Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants