Commit 385c0e83 authored by Hejing Li's avatar Hejing Li Committed by Antoine Kaufmann
Browse files

lib/simbricks/nicbm: add more info to SIGUSR1 debug prints

besides main time, we now also print in and out timestamp of the underlying SimBricks interfaces
parent 2af04fdb
...@@ -70,13 +70,23 @@ static uint64_t s_n2d_poll_sync = 0; ...@@ -70,13 +70,23 @@ static uint64_t s_n2d_poll_sync = 0;
static int stat_flag = 0; static int stat_flag = 0;
#endif #endif
void Runner::PrintBaseIfInfo() {
fprintf(stderr, "net_in_timestamp = %lu\n", nicif_.net.base.in_timestamp);
fprintf(stderr, "net_out_timestamp = %lu\n", nicif_.net.base.out_timestamp);
fprintf(stderr, "pci_in_timestamp = %lu\n", nicif_.pcie.base.in_timestamp);
fprintf(stderr, "pci_out_timestamp = %lu\n", nicif_.pcie.base.out_timestamp);
}
static void sigint_handler(int dummy) { static void sigint_handler(int dummy) {
exiting = 1; exiting = 1;
} }
static void sigusr1_handler(int dummy) { static void sigusr1_handler(int dummy) {
for (Runner *r : runners) for (Runner *r : runners) {
fprintf(stderr, "[%p] main_time = %lu\n", r, r->TimePs()); fprintf(stderr, "[Runner %p] main_time = %lu\n", r, r->TimePs());
r->PrintBaseIfInfo();
}
} }
#ifdef STAT_NICBM #ifdef STAT_NICBM
......
...@@ -180,6 +180,11 @@ class Runner { ...@@ -180,6 +180,11 @@ class Runner {
uint64_t TimePs() const; uint64_t TimePs() const;
uint64_t GetMacAddr() const; uint64_t GetMacAddr() const;
/**
* Print baseif info
*
*/
void PrintBaseIfInfo(void);
}; };
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment