Page MenuHomeFreeBSD

D19851.id55974.diff
No OneTemporary

D19851.id55974.diff

Index: lib/libpmc/Makefile
===================================================================
--- lib/libpmc/Makefile
+++ lib/libpmc/Makefile
@@ -104,4 +104,6 @@
pmclog.3 pmclog_feed.3 \
pmclog.3 pmclog_read.3
+WARNS?= 3
+
.include <bsd.lib.mk>
Index: lib/libpmc/Makefile.inc
===================================================================
--- /dev/null
+++ lib/libpmc/Makefile.inc
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+WARNS?= 3
Index: lib/libpmc/libpmc_json.cc
===================================================================
--- lib/libpmc/libpmc_json.cc
+++ lib/libpmc/libpmc_json.cc
@@ -29,19 +29,21 @@
*/
#include <sys/types.h>
-#include <sys/errno.h>
#include <sys/sysctl.h>
-#include <stddef.h>
-#include <stdlib.h>
+#include <assert.h>
#include <err.h>
+#include <errno.h>
#include <limits.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <pmc.h>
-#include <pmclog.h>
-#include <assert.h>
#include <string>
#include <sysexits.h>
+
+#include <pmc.h>
#include <pmcformat.h>
+#include <pmclog.h>
using std::string;
Index: lib/libpmc/pmu-events/jevents.h
===================================================================
--- lib/libpmc/pmu-events/jevents.h
+++ lib/libpmc/pmu-events/jevents.h
@@ -11,12 +11,4 @@
void *data);
char *get_cpu_str(void);
-#ifndef min
-#define min(x, y) ({ \
- typeof(x) _min1 = (x); \
- typeof(y) _min2 = (y); \
- (void) (&_min1 == &_min2); \
- _min1 < _min2 ? _min1 : _min2; })
-#endif
-
#endif
Index: lib/libpmc/pmu-events/jevents.c
===================================================================
--- lib/libpmc/pmu-events/jevents.c
+++ lib/libpmc/pmu-events/jevents.c
@@ -1,5 +1,3 @@
-#define _XOPEN_SOURCE 500 /* needed for nftw() */
-#define __BSD_VISIBLE 1 /* needed for asprintf() */
/* Parse event JSON files */
/*
@@ -33,22 +31,22 @@
*
*/
-
+#include <sys/param.h>
+#include <sys/resource.h> /* getrlimit */
+#include <sys/stat.h>
+#include <sys/time.h> /* getrlimit */
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <libgen.h>
+#include <limits.h>
+#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <unistd.h>
-#include <stdarg.h>
-#include <libgen.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/time.h> /* getrlimit */
-#include <sys/resource.h> /* getrlimit */
#include <ftw.h>
-#include <sys/stat.h>
#include "list.h"
#include "jsmn.h"
#include "json.h"
@@ -641,7 +639,7 @@
addfield(map, &extra_desc, " ",
"(Precise event)", NULL);
}
- snprintf(buf, sizeof buf, "event=%#llx", eventcode);
+ snprintf(buf, sizeof(buf), "event=%#llx", eventcode);
addfield(map, &event, ",", buf, NULL);
if (desc && extra_desc)
addfield(map, &desc, " ", extra_desc, NULL);
@@ -866,7 +864,7 @@
if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) {
if (rlim.rlim_max == RLIM_INFINITY)
return 512;
- return min((unsigned)rlim.rlim_max / 2, 512);
+ return MIN((unsigned)rlim.rlim_max / 2, 512);
}
return 512;

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 21, 11:19 PM (12 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27117620
Default Alt Text
D19851.id55974.diff (3 KB)

Event Timeline