Skip to content

Commit f65d5ef

Browse files
committed
Merge pull request #4 from keszybz/master
i686 build fixes
2 parents c27dada + 1c39a80 commit f65d5ef

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PROG = numatop
55
CC = gcc
66
LD = gcc
77
CFLAGS = -g -Wall -O2
8+
LDFLAGS = -g
89
LDLIBS = -lncurses -lpthread -lnuma
910

1011
COMMON_OBJS = cmd.o disp.o lwp.o numatop.o page.o perf.o \
@@ -18,7 +19,7 @@ INTEL_OBJS = wsm.o snb.o nhm.o
1819
all: $(PROG)
1920

2021
$(PROG): $(COMMON_OBJS) $(OS_OBJS) $(INTEL_OBJS)
21-
$(LD) -o $@ $(COMMON_OBJS) $(OS_OBJS) $(INTEL_OBJS) $(LDLIBS)
22+
$(LD) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(OS_OBJS) $(INTEL_OBJS) $(LDLIBS)
2223

2324
%.o: ./common/%.c ./common/include/*.h ./common/include/os/*.h
2425
$(CC) $(CFLAGS) -o $@ -c $<

common/numatop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <fcntl.h>
3636
#include <inttypes.h>
3737
#include <stdio.h>
38+
#include <stdbool.h>
3839
#include <string.h>
3940
#include <strings.h>
4041
#include <unistd.h>
@@ -72,7 +73,7 @@ main(int argc, char *argv[])
7273
{
7374
int ret = 1, debug_level = 0;
7475
FILE *log = NULL, *dump = NULL;
75-
boolean_t locked;
76+
boolean_t locked = false;
7677
char c;
7778

7879
if (!os_authorized()) {

common/os/os_win.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,11 @@ latnode_data_show(track_proc_t *proc, dyn_latnode_t *dyn, map_entry_t *entry,
889889
win_size2str(dyn->size, size_str, sizeof (size_str));
890890
if (lwp != NULL) {
891891
(void) snprintf(content, sizeof (content),
892-
"Memory area(%lX, %s), thread(%d)",
892+
"Memory area(%"PRIX64", %s), thread(%d)",
893893
dyn->addr, size_str, lwp->id);
894894
} else {
895895
(void) snprintf(content, sizeof (content),
896-
"Memory area(%lX, %s), process(%d)",
896+
"Memory area(%"PRIX64", %s), process(%d)",
897897
dyn->addr, size_str, proc->pid);
898898
}
899899

common/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ debug_print(FILE *out, int level, const char *fmt, ...)
127127
if (s_logfile != NULL) {
128128
(void) pthread_mutex_lock(&s_debug_ctl.mutex);
129129
(void) fprintf(s_logfile,
130-
"%lu: ", current_ms() / 1000);
130+
"%"PRIu64": ", current_ms() / 1000);
131131
va_start(ap, fmt);
132132
(void) vfprintf(s_logfile, fmt, ap);
133133
va_end(ap);
@@ -138,7 +138,7 @@ debug_print(FILE *out, int level, const char *fmt, ...)
138138
} else {
139139
(void) pthread_mutex_lock(&s_debug_ctl.mutex);
140140
(void) fprintf(out,
141-
"%lu: ", current_ms() / 1000);
141+
"%"PRIu64": ", current_ms() / 1000);
142142
va_start(ap, fmt);
143143
(void) vfprintf(out, fmt, ap);
144144
va_end(ap);

common/win.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,17 +1979,17 @@ win_size2str(uint64_t size, char *buf, int bufsize)
19791979
* "buf" points to a big enough buffer.
19801980
*/
19811981
if ((i = (size / KB_BYTES)) < KB_BYTES) {
1982-
(void) snprintf(buf, bufsize, "%luK", i);
1982+
(void) snprintf(buf, bufsize, "%"PRIu64"K", i);
19831983
} else if ((j = i / KB_BYTES) < KB_BYTES) {
19841984
if ((i % KB_BYTES) == 0) {
1985-
(void) snprintf(buf, bufsize, "%luM", j);
1985+
(void) snprintf(buf, bufsize, "%"PRIu64"M", j);
19861986
} else {
19871987
(void) snprintf(buf, bufsize, "%.1fM",
19881988
(double)i / (double)KB_BYTES);
19891989
}
19901990
} else {
19911991
if ((j % KB_BYTES) == 0) {
1992-
(void) snprintf(buf, bufsize, "%luG", j / KB_BYTES);
1992+
(void) snprintf(buf, bufsize, "%"PRIu64"G", j / KB_BYTES);
19931993
} else {
19941994
(void) snprintf(buf, bufsize, "%.1fG",
19951995
(double)j / (double)KB_BYTES);
@@ -2021,16 +2021,16 @@ win_lat_str_build(char *buf, int size, int idx, void *pv)
20212021
win_size2str(line->bufaddr.size, size_str, sizeof (size_str));
20222022

20232023
if (!line->nid_show) {
2024-
(void) snprintf(buf, size, "%16lX%8s%10.1f%11lu%34s",
2024+
(void) snprintf(buf, size, "%16"PRIX64"%8s%10.1f%11"PRIu64"%34s",
20252025
line->bufaddr.addr, size_str, hit * 100.0, cyc2ns(lat),
20262026
line->desc);
20272027
} else {
20282028
if (line->nid < 0) {
2029-
(void) snprintf(buf, size, "%16lX%8s%8s%10.1f%11lu",
2029+
(void) snprintf(buf, size, "%16"PRIX64"%8s%8s%10.1f%11"PRIu64,
20302030
line->bufaddr.addr, size_str, "-", hit * 100.0,
20312031
cyc2ns(lat));
20322032
} else {
2033-
(void) snprintf(buf, size, "%16lX%8s%8d%10.1f%11lu",
2033+
(void) snprintf(buf, size, "%16"PRIX64"%8s%8d%10.1f%11"PRIu64,
20342034
line->bufaddr.addr, size_str, line->nid,
20352035
hit * 100.0, cyc2ns(lat));
20362036
}
@@ -2314,12 +2314,12 @@ win_lat_data_show(track_proc_t *proc, dyn_lat_t *dyn, boolean_t *note_out)
23142314
if (lwp == NULL) {
23152315
(void) snprintf(content, sizeof (content),
23162316
"Monitoring memory areas (pid: %d, "
2317-
"AVG.LAT: %luns, interval: %s)",
2317+
"AVG.LAT: %"PRIu64"ns, interval: %s)",
23182318
proc->pid, cyc2ns(lat), intval_buf);
23192319
} else {
23202320
(void) snprintf(content, sizeof (content),
23212321
"Monitoring memory areas (lwpid: %d, "
2322-
"AVG.LAT: %luns, interval: %s)",
2322+
"AVG.LAT: %"PRIu64"ns, interval: %s)",
23232323
lwp->id, cyc2ns(lat), intval_buf);
23242324
}
23252325

@@ -2462,7 +2462,7 @@ accdst_str_build(char *buf, int size, int idx, void *pv)
24622462
accdst_line_t *lines = (accdst_line_t *)pv;
24632463
accdst_line_t *line = &lines[idx];
24642464

2465-
(void) snprintf(buf, size, "%5d%14.1f%15lu",
2465+
(void) snprintf(buf, size, "%5d%14.1f%15"PRIu64,
24662466
line->nid, line->access_ratio * 100.0, cyc2ns(line->latency));
24672467
}
24682468

0 commit comments

Comments
 (0)