Skip to content

Commit

Permalink
perf-counter: Fix segfaults on non-Linux platforms.
Browse files Browse the repository at this point in the history
Commit 0eee08dbddea520536197657da7a0b (perf-counter: simplify the
performance macro) introduces the PERF macro, which is empty for non-linux
platforms.

Added to commit bc487ae (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 <[email protected]>
[[email protected] added {} around the macro expansion]
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and blp committed Jul 24, 2015
1 parent 44dbb3e commit e815413
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/perf-counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit e815413

Please sign in to comment.