Date | Commit message (Collapse) |
|
RARRAY_PTR is expensive with GCs in Ruby 2.1.0dev and Rubinius, so
use rb_ary_entry for non-performance critical paths. Eventually,
RARRAY_AREF/RARRAY_ASET may be common, but for now, using
rb_ary_entry should require the least cognitive overhead for a
developer.
|
|
Using an extra 4 bytes for the listener_stats should not
significantly increase space usage, and it has the side benefit
of making our code slightly smaller.
$ ~/linux/scripts/bloat-o-meter before.so after.so
add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-32 (-18)
function old new delta
tcp_stats 392 406 +14
st_to_hash 195 187 -8
diag 763 739 -24
|
|
This initialization was unnecessary and avoids the following
warning with -Wmissing-braces on gcc 4.7.2-5 on Debian testing:
linux_inet_diag.c: In function ‘stats_for’:
linux_inet_diag.c:192:8: warning: missing braces around initializer [-Wmissing-braces]
linux_inet_diag.c:192:8: warning: (near initialization for ‘sa.ss’) [-Wmissing-braces]
|
|
This is exported (visibly) under Ruby 1.9.3 but not
in headers, so it was causing warnings.
|
|
A non-profit TLD makes more sense for a Free Software project.
|
|
No need to cast when C has handy unions. Maybe the compiler
will be able to make better optimization choices here, but
at least it'll be less noisy.
|
|
Seems to breaks under newer libc headers (on Debian sid).
|
|
|
|
Very few programs can take advantage of inheriting FDs
across exec() boundaries, and inet_diag sockets have no
reason to be used in this way.
|
|
It can detect cross-thread close() calls
|
|
Oops :x This was totally broken with the all-listener
filter.
|
|
|
|
getaddrinfo() needs to get a list of available interfaces
from the kernel with every single call (since ipv6 could've
been modprobed), so it's a waste of syscalls.
|
|
No need to waste resources on creating/destroying
a socket.
|
|
I thought my compiler would be smarter :<
|
|
The way we dump, we dump it all, it seems.
|
|
This means we can read multiple addresses at once,
even IPv6 ones.
|
|
It's slow, but at least it works.
|
|
No reason to have an extra method. This also speeds up
the multi-listener case for tcp_listener_stats since it
avoids expensive sendmsg() syscalls.
|
|
|
|
netlink is fast and predictable in response times, so permitting
interrupts would just complicate things and lead to errors.
|
|
Fewer places to check for errors, we think.
|
|
Be stricter about invalid inputs.
|
|
This is a work-in-progress and will probably be modified
before the next release.
|
|
64-bit counters are unnecessarily large for tracking
active or queued connections until we have IP_ROFLSCALE
support :>
|
|
Oops :x
|
|
Too hard to maintain.
|
|
We can't have negative values
|
|
We don't care for this address.
|
|
Oops, strings are always true :x
|
|
We're going to experiment with something...
|
|
We might reuse that for other code...
|
|
We'll be doing more Linux-only stuff
|
|
inet_diag already supports AF_INET6.
|
|
Acked-by: Eric Wong <normalperson@yhbt.net>
|
|
This allows us to build and link correctly on FreeBSD 7.0
|
|
Rubinius does not include macros for accessing
Struct members in the C API.
ref: http://github.com/evanphx/rubinius/issues/494
|
|
This allows non-GCC 4.x users to experience Raindrops.
|
|
"query_addr" is a more appropriate name since we only query one
address at a time via netlink rather than relying on OR-ing in
the bytecode.
|
|
|
|
|