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

Add support for collecting Aperf Run logs #232

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Add support for collecting Aperf Run logs #232

merged 1 commit into from
Dec 3, 2024

Conversation

janaknat
Copy link
Contributor

Switch to using log4rs crate which allows all prints from aperf to be shown both in the console and a file. This file can be used to see the run prints during the record phase. Attached a report with the runlog.

kbuildlog.tar.gz

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@janaknat janaknat requested a review from a team as a code owner September 24, 2024 16:45
src/bin/aperf.rs Outdated
Comment on lines 52 to 58
"[{d(%Y-%m-%dT%H:%M:%SZ)} {h({l}):5.5} {M}] {m}{n}",
)))
.build();

let fileout = FileAppender::builder()
.encoder(Box::new(PatternEncoder::new(
"[{d(%Y-%m-%dT%H:%M:%SZ)} {h({l}):5.5} {M}] {m}{n}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you intend the patterns to diverge, factor out the PatternEncoder so it's not written twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@@ -24,6 +24,7 @@
<button class="tablinks" name="interrupts">Interrupt Data</button>
<button class="tablinks" name="disk_stats">Disk Stats</button>
<button class="tablinks" name="netstat">Net Stats</button>
<button class="tablinks" name="aperfrunlog">Aperf Runlog</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

We're already at too many tabs. They can be vertically shrunk some to buy time, but I think we'll have to start collapsing some of this. For example, just have a single 'Internals' tab, under which there are the aperf internal stats and now runlog (possibly via a sub-tab).

@wash-amzn
Copy link
Contributor

wash-amzn commented Sep 27, 2024

We're going to want to configure different levels for the stdout vs file loggers (and the command-line option for verbosity should not affect the file log). Make sure you can at least do that with the current design. Trace level would be awesome for the file log, but at least debug level.

By default, the runlog will always collect at LevelFilter::Debug level.
The users' choice determines what gets printed to the console.

Also, rename the lib to 'aperf'. This will allow us to use the
CARGO_CRATE_NAME when creating the logger.
@janaknat
Copy link
Contributor Author

janaknat commented Dec 2, 2024

We're going to want to configure different levels for the stdout vs file loggers (and the command-line option for verbosity should not affect the file log). Make sure you can at least do that with the current design. Trace level would be awesome for the file log, but at least debug level.

By default, we now log in the file at Debug level. The console out is still based on the users choice.

@janaknat janaknat merged commit c88030f into main Dec 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants