Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Add support to configure reporting historical ANRs via `AndroidManifest.xml` using the `io.sentry.anr.report-historical` attribute ([#5387](https://github.com/getsentry/sentry-java/pull/5387))

### Dependencies

- Upgrade to asyncProfiler 4.4 ([#5418](https://github.com/getsentry/sentry-java/pull/5418))

## 8.41.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ androidxLifecycle = "2.2.0"
androidxNavigation = "2.4.2"
androidxTestCore = "1.7.0"
androidxCompose = "1.6.3"
asyncProfiler = "4.2"
asyncProfiler = "4.4"
composeCompiler = "1.5.14"
coroutines = "1.6.1"
espresso = "3.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

@ApiStatus.Internal
public final class JfrAsyncProfilerToSentryProfileConverter extends JfrConverter {
private static final double NANOS_PER_SECOND = 1_000_000_000.0;
private static final long UNKNOWN_THREAD_ID = -1;

private final @NotNull SentryProfile sentryProfile = new SentryProfile();
Expand Down Expand Up @@ -83,7 +82,6 @@ private class ProfileEventVisitor implements EventCollector.Visitor {
private final @NotNull SentryStackTraceFactory stackTraceFactory;
private final @NotNull JfrReader jfr;
private final @NotNull Arguments args;
private final double ticksPerNanosecond;

public ProfileEventVisitor(
@NotNull SentryProfile sentryProfile,
Expand All @@ -94,7 +92,6 @@ public ProfileEventVisitor(
this.stackTraceFactory = stackTraceFactory;
this.jfr = jfr;
this.args = args;
ticksPerNanosecond = jfr.ticksPerSec / NANOS_PER_SECOND;
}

@Override
Expand Down Expand Up @@ -150,11 +147,7 @@ private void processSampleWithStack(Event event, long threadId, StackTrace stack
}

private double calculateTimestamp(Event event) {
long nanosFromStart = (long) ((event.time - jfr.chunkStartTicks) / ticksPerNanosecond);

long timeNs = jfr.chunkStartNanos + nanosFromStart;

return DateUtils.nanosToSeconds(timeNs);
return DateUtils.nanosToSeconds(jfr.eventTimeToNanos(event.time));
}

private int addStackTrace(StackTrace stackTrace) {
Expand Down
Loading