#2981 - ENH: Add profile-line-number-mode with options none | all | auto ... to control adding line numbers to profile locations

This commit is contained in:
rob committed 2023-02-22 23:02:42 +13:00
1 parent 34dc4375da
commit 2e0dba3741
16 files changed
+85 -26

No files matched your search

@@ -12,12 +12,14 @@ class DProfileLocation implements ProfileLocation {
private static final String UNKNOWN = "unknown";
private final boolean withLine;
private String fullLocation;
private String location;
private String label;
private int traceCount;
DProfileLocation() {
DProfileLocation(boolean withLine) {
this.withLine = withLine;
}
@Override
@@ -37,7 +39,7 @@ class DProfileLocation implements ProfileLocation {
return false;
}
final String loc = create();
final String location = UtilLocation.loc(loc);
final String location = UtilLocation.loc(loc, withLine);
this.label = UtilLocation.label(location);
this.location = location;
this.fullLocation = loc;
@@ -11,7 +11,12 @@ public final class DProfileLocationFactory implements SpiProfileLocationFactory
@Override
public ProfileLocation create() {
return new DProfileLocation();
return new DProfileLocation(false);
}
@Override
public ProfileLocation createWithLine() {
return new DProfileLocation(true);
}
@Override
@@ -16,6 +16,7 @@ final class DTimedProfileLocation extends DProfileLocation implements TimedProfi
private String reportName;
DTimedProfileLocation(String label, TimedMetric timedMetric) {
super(false);
this.label = label;
this.timedMetric = timedMetric;
this.overrideMetricName = "".equals(label);