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

Use absolute paths for async-profiler output files #383

Merged
merged 3 commits into from
Dec 15, 2021

Conversation

asodja
Copy link
Member

@asodja asodja commented Dec 14, 2021

When testing Android Studio sync with gradle-profiler I noticed after a long debugging session that profiler does not work if absolute --output-dir is not set. This fixes it so absolute paths are passed in JVM args.

When testing Android Studio sync with gradle-profiler I noticed after a long debugging session that profiler does not work if absolute --output-dir is not set. This fixes it so absolute paths are passed in JVM args.
@asodja asodja self-assigned this Dec 14, 2021
@asodja asodja added @execution internal Internal change labels Dec 14, 2021
@asodja asodja requested a review from a team December 14, 2021 16:29
Copy link
Member

@wolfs wolfs left a comment

Choose a reason for hiding this comment

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

This probably fixes the absolute path problem for async profiler. Are other profilers affected as well?

@@ -34,7 +34,7 @@ public static AsyncProfilerOutputType from(AsyncProfilerConfig config, GradleSce
abstract File outputFileFor(ScenarioSettings settings);

File individualOutputFileFor(ScenarioSettings settings) {
File outputFile = outputFileFor(settings);
File outputFile = outputFileFor(settings).getAbsoluteFile();
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better if outputFileFor would return an absolute file already.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

I also tested jfr, YourKit, JProfiler and they don't have this issue.

@@ -9,13 +9,13 @@
STACKS("collapsed") {
@Override
File outputFileFor(ScenarioSettings settings) {
return settings.profilerOutputLocationFor(".stacks.txt");
return settings.profilerOutputLocationFor(".stacks.txt").getAbsoluteFile();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should go even deeper: It seems like ScenarioDefinition.getOutputDir() or ScenarioDefinition.outputDir should always be an absolute file. Then the rest would follow automatically I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can do that

Copy link
Member

@wolfs wolfs left a comment

Choose a reason for hiding this comment

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

LGTM!

@asodja asodja merged commit ea32cd9 into master Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants