summaryrefslogtreecommitdiff
path: root/lib/seq.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-04-30 14:34:27 -0700
committerBen Pfaff <blp@nicira.com>2014-05-22 09:39:49 -0700
commit2113847254249710deff9455fc541330542305de (patch)
tree7755201f932f4490028611418b3f1b83e892aee7 /lib/seq.h
parenteaf004bd8f5b3f7473458426ef8d0265c0f27652 (diff)
downloadopenvswitch-2113847254249710deff9455fc541330542305de.tar.gz
seq: Attribute wakeups to seq_wait()'s caller, not to seq_wait() itself.
The poll_loop code has a feature that, when turned on manually or automatically (due to high CPU use), logs the source file and line number of the code that caused a thread to wake up from poll(). Until now, when a function calls seq_wait(), the source file and line number logged was the code inside seq_wait(). seq_wait() has many callers, so that information is not as useful as it could be. This commit changes the source file and line number used to be that of seq_wait()'s caller. I found this useful for debugging. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/seq.h')
-rw-r--r--lib/seq.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/seq.h b/lib/seq.h
index c764809e5..38c0e5275 100644
--- a/lib/seq.h
+++ b/lib/seq.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Nicira, Inc.
+ * Copyright (c) 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -111,6 +111,7 @@
*/
#include <stdint.h>
+#include "util.h"
/* For implementation of an object with a sequence number attached. */
struct seq *seq_create(void);
@@ -119,7 +120,9 @@ void seq_change(struct seq *);
/* For observers. */
uint64_t seq_read(const struct seq *);
-void seq_wait(const struct seq *, uint64_t value);
+
+void seq_wait_at(const struct seq *, uint64_t value, const char *where);
+#define seq_wait(seq, value) seq_wait_at(seq, value, SOURCE_LOCATOR)
/* For poll_block() internal use. */
void seq_woke(void);