diff options
author | Ben Pfaff <blp@nicira.com> | 2012-05-08 15:44:21 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-05-22 10:32:05 -0700 |
commit | 0d085684619be0baef309957a3d7410a23cb5f27 (patch) | |
tree | 212ad7c9bd8e67c80065da7ed1968f6a5bd5af61 /ofproto/pinsched.c | |
parent | 44bac24ba5d22fe238bd96702707eb2029efec41 (diff) | |
download | openvswitch-0d085684619be0baef309957a3d7410a23cb5f27.tar.gz |
Add support for tracking and logging daemon memory usage.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto/pinsched.c')
-rw-r--r-- | ofproto/pinsched.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index 9053ea267..41e9c8dd4 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -320,3 +320,11 @@ pinsched_set_limits(struct pinsched *ps, int rate_limit, int burst_limit) drop_packet(ps); } } + +/* Returns the number of packets scheduled to be sent eventually by 'ps'. + * Returns 0 if 'ps' is null. */ +unsigned int +pinsched_count_txqlen(const struct pinsched *ps) +{ + return ps ? ps->n_txq : 0; +} |