Conversation
|
Signed CLA has been sent. This looks good to merge history wise, just let me know if you want any changes. |
| 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); |
There was a problem hiding this comment.
We have SEL4_PRIu_word for this now
There was a problem hiding this comment.
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 is seL4_Word, which should already be unsigned long. Am I missing something?
I.e. would simply
fprintf(fd, "Number of system call invocations %"SEL4_PRIu_word"\n", syscall_entries);be correct now? (for both 32 and 64)
There was a problem hiding this comment.
Actually, they all seem to be seL4_Word, so thy all should use SEL4_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 add SEL4_PRIzpu_word or SEL4_PRIu_word_zp to zero-prefix it...
Fix errors on 64-bit. Signed-off-by Gerwin Klein <[email protected]>
| 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.
There is "*" in the printf() format args that we could use here to make this generic:
| fprintf(fd, "| %-15lu| %-15lu| %-15"PRIu64"| %-15lu| %-15lu| %-15lu| %-15lu|\n", | |
| #define WORD_INDENT ((CONFIG_WORD_SIZE / 4) - 1) | |
| fprintf(fd, "| %-*"SEL4_PRIu_word"| %-*"SEL4_PRIu_word"| %-*"PRIu64"| %-*"SEL4_PRIu_word"| %-*"SEL4_PRIu_word"| %-*"SEL4_PRIu_word"| %-*"SEL4_PRIu_word"|\n", | |
| WORD_INDENT, index, | |
| WORD_INDENT, logBuffer[index].entry.syscall_no, | |
| WORD_INDENT, logBuffer[index].start_time, | |
| WORD_INDENT, logBuffer[index].duration, | |
| WORD_INDENT, logBuffer[index].entry.cap_type, | |
| WORD_INDENT, logBuffer[index].entry.invocation_tag, | |
| WORD_INDENT, logBuffer[index].entry.is_fastpath); |
Fix errors on 64-bit.