Skip to content

Commit ad1946b

Browse files
authored
Merge pull request #87 from arielb1/troubleshooting-tsc
doc: add comment for troubleshooting tsc in a JVM context
2 parents 704a453 + 9295985 commit ad1946b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,25 @@ the stack trace which will not go past one or two `unknown` frames.
190190

191191
[`jfrs`]: https://docs.rs/jfrs
192192

193+
### Dealing with `Error: decoder only supports tsc profiles, not "monotonic"`
194+
195+
Pollcatch uses the CPU timestamp counter (tsc) to correlate profiles, and requires async-profiler to use the
196+
CPU timestamp counter as well. async-profiler normally tries to use the tsc, and only reverts to using the
197+
`monotonic` counter if it's unable to.
198+
199+
Potential causes for async-profiler not being able to use the timestamp counter:
200+
201+
1. An architecture that is not supported by async-profiler (currently, only x86-64 and aarch64 are supported)
202+
2. If you are loading a Java Virtual Machine (JVM) into your process, async-profiler tries to coordinate with
203+
the JVM's timestamp mechanism. If that fails due to some JVM support or integration issue, it will revert to
204+
using the monotonic clock, which will not work with pollcatch.
205+
206+
If you encounter this problem, you can work-around it by initializing the async-profiler Rust agent
207+
before you initialize the JVM. This will make the Java-specific analyses work less well, but they are
208+
generally less important in a pollcatch context.
209+
210+
In either case, it might be worth reporting an issue to the async-profiler team.
211+
193212
## Security
194213

195214
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

0 commit comments

Comments
 (0)