aboutsummaryrefslogtreecommitdiff
path: root/lib/coverage.c
AgeCommit message (Collapse)Author
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-26coverage: Make ovs-appctl command more useful and less alarming.Ben Pfaff
I've had a few complaints that ovs-vswitchd logs its coverage counters at WARN level, but this is mainly wrong: ovs-vswitchd only logs coverage counters at WARN level when the "coverage/log" command is used through ovs-appctl. This was even documented. The reason to log at such a high level was to make it fairly certain that these messages specifically requested by the admin would not be filtered out before making it to the log. But it's even better if the admin just gets the coverage counters as a reply to the ovs-appctl command. So that is what this commit does. This commit also improves the documentation of the ovs-appctl command. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-26coverage: Rate-limit logging coverage information.Ben Pfaff
I'd always assumed that the exponentially weighted moving average code in timeval was enough rate-limiting, but I actually encountered a pathological case some time ago that forced this coverage information to print once a second or so, which seems too often. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-21unixctl: New JSON RPC back-end.Ethan Jackson
The unixctl library had used the vde2 management protocol since the early days of Open vSwitch. As Open vSwitch has matured, several Python daemons have been added to the code base which would benefit from a unixctl implementations. Instead of implementing the old unixctl protocol in Python, this patch changes unixctl to use JSON RPC for which we already have an implementation in both Python and C. Future patches will need to implement a unixctl library in Python on top of JSON RPC. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-07coverage: Time out the coverage hash suppression once a day.Ben Pfaff
Otherwise coverage log messages will eventually get rotated out of the system logs and never reappear (before restarting a given daemon). Bug #1452. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19unixctl: Implement quoting.Ben Pfaff
The protocol used by ovs-appctl has a long-standing bug that there is no way to distinguish "ovs-appctl a b c" from "ovs-appctl 'a b c'". This isn't a big deal because none of the current commands really want to accept arguments that include spaces, but it's kind of a silly limitation. At the same time, the internal API is awkward because every user is stuck doing its own argument parsing, which is no fun. This commit fixes both problems, by adding shell-like quoting to the protocol and modifying the internal API from one that passes a string to one that passes in an array of pre-parsed strings. Command implementations may now specify how many arguments they expect. This simplifies some command implementations significantly. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-09-29ovs-appctl: Print command arguments for "help".Justin Pettit
2010-11-30coverage: Make the coverage counters catalog program-specific.Ben Pfaff
Until now, the collection of coverage counters supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with mac_learning, it still has a coverage counter for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that files that include coverage counters must be listed on COVERAGE_FILES in lib/automake.mk. This commit also fixes the annoyance that modifying any source file that includes a coverage counter caused all programs that link against libopenvswitch.a to relink, even programs that the source file was not linked into. For example, modifying ofproto/ofproto.c (which includes coverage counters) caused tests/test-aes128 to relink, even though test-aes128 does not link again ofproto.o.
2010-10-29vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.Ben Pfaff
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon, so this commit switches to the more common form.
2010-08-30treewide: Remove trailing whitespaceJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-07-21vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.Ben Pfaff
Adding a macro to define the vlog module in use adds a level of indirection, which makes it easier to change how the vlog module must be defined. A followup commit needs to do that, so getting these widespread changes out of the way first should make that commit easier to review.
2010-02-11Merge "master" into "next".Ben Pfaff
The main change here is the need to update all of the uses of UNUSED in the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.Ben Pfaff
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2009-10-29unixctl: Allow passing auxiliary data to unixctl commands.Ben Pfaff
This will allow users of unixctl to avoid using global variables, leading to cleaner code.
2009-09-11logging: Lower logging level for coverage messages due to slow poll loopsJustin Pettit
By default, many OVS processes keep track of their time through a poll loop. If it takes an unusually long time (measured as some distance from the mean), the processes will log stats it has been keeping about coverage. It was doing this at level WARN. On Xen systems, syslog messages written at level INFO and higher are written to /var/log/messages synchronously. This would mean that there would be dire messages that it took a few dozen milliseconds to go through the loop, meanwhile, it would take up to 6(!) seconds writing those. Meanwhile, the process would do no other processing, which could be quite serious in the case of a process such as ovs-vswitchd. This problem was somewhat masked because the time used by this logging was not used in the calculations for determining how long it was taking to get through the loop. This commit lowers the default log level for those coverage messages to INFO. On Xen systems, it raises the default level at which messages are written to syslog to WARN. Diagnosed and fixed with the help of Ian Campbell.
2009-07-14Fix unitialized variable in coverage_log()Justin Pettit
When providing the ability to force coverage printouts to occur, some code was moved around that allowed the "hash" variable to be used unitialized. This fixes that. Thanks to Ben for pointing out the problem. Bug #1577
2009-07-10Remove "coverage/clear" command due its limited useJustin Pettit
The poll loop calls coverage_clear on every pass anyway, so provide a function to call it separately is of limited value.
2009-07-10Provide ability to retrieve coverage informationJustin Pettit
Previously, there was no way to induce coverage information to be displayed; it would only print when the system noticed unusual delays between polling intervals. Now, production of coverage logs can be forced with "coverage/log" command in ovs-appctl. Coverage counters may be reset with "coverage/clear".
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff