From 2113847254249710deff9455fc541330542305de Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 30 Apr 2014 14:34:27 -0700 Subject: 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 --- lib/seq.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/seq.h') 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 +#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); -- cgit v1.2.1