-
Notifications
You must be signed in to change notification settings - Fork 67
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
sel4utils: update benchmark_track.h #15
Open
pingerino
wants to merge
1
commit into
seL4:master
Choose a base branch
from
pingerino:alyons/64-bit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16
−16
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -39,10 +39,10 @@ static inline void seL4_BenchmarkTrackDumpSummary(benchmark_track_kernel_entry_t | |||||||||||||||||||||
index++; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
fprintf(fd, "Number of system call invocations %d\n", syscall_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of interrupt invocations %d\n", interrupt_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of user-level faults %d\n", userlevelfault_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of VM faults %d\n", vmfault_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of system call invocations %lu\n", (unsigned long) syscall_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of interrupt invocations %lu\n", (unsigned long) interrupt_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of user-level faults %lu\n", (unsigned long) userlevelfault_entries); | ||||||||||||||||||||||
fprintf(fd, "Number of VM faults %lu\n", (unsigned long) vmfault_entries); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/* Print out logged system call invocations */ | ||||||||||||||||||||||
|
@@ -62,14 +62,14 @@ static inline void seL4_BenchmarkTrackDumpFullSyscallLog(benchmark_track_kernel_ | |||||||||||||||||||||
|
||||||||||||||||||||||
while (logBuffer[index].start_time != 0 && (index * sizeof(benchmark_track_kernel_entry_t)) < logSize) { | ||||||||||||||||||||||
if (logBuffer[index].entry.path == Entry_Syscall) { | ||||||||||||||||||||||
fprintf(fd, "| %-15d| %-15d| %-15llu| %-15d| %-15d| %-15d| %-15d|\n", | ||||||||||||||||||||||
index, | ||||||||||||||||||||||
logBuffer[index].entry.syscall_no, | ||||||||||||||||||||||
(uint64_t) logBuffer[index].start_time, | ||||||||||||||||||||||
logBuffer[index].duration, | ||||||||||||||||||||||
logBuffer[index].entry.cap_type, | ||||||||||||||||||||||
logBuffer[index].entry.invocation_tag, | ||||||||||||||||||||||
logBuffer[index].entry.is_fastpath); | ||||||||||||||||||||||
fprintf(fd, "| %-15lu| %-15lu| %-15"PRIu64"| %-15lu| %-15lu| %-15lu| %-15lu|\n", | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is "*" in the printf() format args that we could use here to make this generic:
Suggested change
|
||||||||||||||||||||||
(unsigned long) index, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].entry.syscall_no, | ||||||||||||||||||||||
logBuffer[index].start_time, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].duration, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].entry.cap_type, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].entry.invocation_tag, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].entry.is_fastpath); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
index++; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
@@ -91,11 +91,11 @@ static inline void seL4_BenchmarkTrackDumpFullInterruptLog(benchmark_track_kerne | |||||||||||||||||||||
|
||||||||||||||||||||||
while (logBuffer[index].start_time != 0 && (index * sizeof(benchmark_track_kernel_entry_t)) < logSize) { | ||||||||||||||||||||||
if (logBuffer[index].entry.path == Entry_Interrupt) { | ||||||||||||||||||||||
fprintf(fd, "| %-15d| %-15d| %-15llu| %-15d|\n", \ | ||||||||||||||||||||||
index, | ||||||||||||||||||||||
logBuffer[index].entry.word, | ||||||||||||||||||||||
fprintf(fd, "| %-15lu| %-15lu| %-15"PRIu64"| %-15lu|\n", \ | ||||||||||||||||||||||
(unsigned long) index, | ||||||||||||||||||||||
(unsigned long) logBuffer[index].entry.word, | ||||||||||||||||||||||
logBuffer[index].start_time, | ||||||||||||||||||||||
logBuffer[index].duration); | ||||||||||||||||||||||
(unsigned long) logBuffer[index].duration); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
index++; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have
SEL4_PRIu_word
for this nowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to update this, but I want to make sure I understand what I'm doing first :). If I traced this correctly,
syscall_entries
isseL4_Word
, which should already beunsigned long
. Am I missing something?I.e. would simply
be correct now? (for both 32 and 64)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, they all seem to be
seL4_Word
, so thy all should useSEL4_PRIu_word
. And using"bla bla %15"SEL4_PRIu_word" bla bla"
will also work. The issue here is that it would be 7 on 32-bit and 15 on 64-bit, but currently we have no constant we can use here. I've ran into this on another place also recently and thinking about a way to resolve this. The current way is always using %15"SEL4_PRIu_word" then. We could addSEL4_PRIzpu_word
orSEL4_PRIu_word_zp
to zero-prefix it...