perf-counter: Fix segfaults on non-Linux platforms.
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Fri, 24 Jul 2015 15:22:56 +0000 (12:22 -0300)
committerBen Pfaff <blp@nicira.com>
Fri, 24 Jul 2015 16:20:05 +0000 (09:20 -0700)
Commit 0eee08dbddea520536197657da7a0b (perf-counter: simplify the
performance macro) introduces the PERF macro, which is empty for non-linux
platforms.

Added to commit bc487aeff2d6823c088d6e4499e0f53e6651523b (ovsdb: Add per
transaction commit instruction counter), that uses such macro, it causes
segfaults, since it makes ovsdb_txn_commit return an uninitialized pointer as
error.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
[blp@nicira.com added {} around the macro expansion]
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/perf-counter.h

index ca3aaba..bdfb672 100644 (file)
@@ -113,7 +113,7 @@ char *perf_counters_to_string(void);
           perf_counter_accumulate(&c, start_count);               \
       }
 #else
-#define PERF(name, expr)
+#define PERF(name, expr) { expr; }
 
 static inline void perf_counters_init(void) {}
 static inline void perf_counters_destroy(void) {}