Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162835254
D36347.id109818.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36347.id109818.diff
View Options
Index: usr.sbin/pmcstat/pmcstat.c
===================================================================
--- usr.sbin/pmcstat/pmcstat.c
+++ usr.sbin/pmcstat/pmcstat.c
@@ -119,6 +119,9 @@
struct pmcstat_args args;
static bool libpmc_initialized = false;
+/* Allow for a 3 digit CPU ID */
+#define PMC_CPU_WIDTH 3
+
static void
pmcstat_get_cpumask(const char *cpuspec, cpuset_t *cpumask)
{
@@ -288,8 +291,9 @@
w = ev->ev_fieldwidth - ev->ev_fieldskip - 2;
if (c == 's')
- (void) fprintf(args.pa_printfile, "s/%02d/%-*s ",
- ev->ev_cpu, w-3, ev->ev_name);
+ (void) fprintf(args.pa_printfile,
+ "s/%0"__XSTRING(PMC_CPU_WIDTH)"d/%-*s ",
+ ev->ev_cpu, w - PMC_CPU_WIDTH - 1, ev->ev_name);
else
(void) fprintf(args.pa_printfile, "p/%*s ", w,
ev->ev_name);
@@ -1213,7 +1217,8 @@
display_width = (int) floor(counter_width / 3.32193) + 1;
if (PMC_IS_SYSTEM_MODE(ev->ev_mode))
- header_width += 3; /* 2 digit CPU number + '/' */
+ /* CPU number + '/' */
+ header_width += PMC_CPU_WIDTH + 1;
if (header_width > display_width) {
ev->ev_fieldskip = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 18, 10:12 AM (18 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35195127
Default Alt Text
D36347.id109818.diff (1 KB)
Attached To
Mode
D36347: Make the CPU width a macro
Attached
Detach File
Event Timeline
Log In to Comment