Skip to content

Commit

Permalink
Fix tiny bug
Browse files Browse the repository at this point in the history
  • Loading branch information
parttimenerd committed Dec 3, 2023
1 parent 2b53935 commit a0fe0f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
- Altered interval computation to be closer to the average interval

### Fixed
- Fixed handling of RecordMethods across multiple chunks #6
- Fixed handling of RecordMethods across multiple chunks #6
- Omit line numbers for functions #6
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 0.0.2-SNAPSHOT
version = 0.0.3-SNAPSHOT
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 5 additions & 1 deletion src/main/kotlin/me/bechberger/jfrtofp/processor/Tables.kt
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class FuncTableWrapper(val tables: Tables) {
resourcess.add(-1)
fileNames.add(null)
sourceUrls.add(tables.defaultUrl?.let { tables.getString(it) })
lineNumbers.add(-1)
index
}
}
Expand Down Expand Up @@ -361,7 +362,10 @@ class FrameTableWrapper(val tables: Tables) {
internal fun getFrame(
frame: RecordedFrame
): IndexIntoFrameTable {
val func = tables.getFunction(frame.method, frame.isJavaFrame, frame.lineNumber)
// we don't know the start line of the function from JFR
// so we use -1, to signal the profile viewer that it is invalid
// Related to https://github.com/parttimenerd/jfrtofp/issues/6
val func = tables.getFunction(frame.method, frame.isJavaFrame, -1)
val line = if (frame.lineNumber == -1) null else frame.lineNumber

return map.computeIfAbsent(func to line) {
Expand Down

0 comments on commit a0fe0f5

Please sign in to comment.