about summary refs log tree commit homepage
path: root/ext
DateCommit message (Collapse)
2013-06-16linux_inet_diag: improve compatibility with newer GCs gc-next
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.
2013-04-20linux_inet_diag: better align listener_stats struct
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
2013-04-11linux_inet_diag: avoid unnecessary sockaddr initialization
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]
2013-04-11Linux::TCP_Info: implement #get! instance method
This allows reusing existing Linux::TCP_Info objects to avoid generating garbage.
2013-04-11raindrops: favor configured processor count over online count
The runnable CPUs of a process may change over the lifetime of the process. So favor the count of configured processor count since that is more likely to be stable. We do not currently do not have special handling for hot-plugging/removal of CPUs on systems that may load raindrops in a single CPU state.
2012-05-12avoid warning for rb_thread_io_blocking_region
This is exported (visibly) under Ruby 1.9.3 but not in headers, so it was causing warnings.
2012-05-10extconf: better check for GCC atomic builtins
Attempting to test for CMPXCHG on x86 should allow this check to fail on i386 systems. We also won't need try_run as a result, enabling cross-compilation. The configure.in check in Ruby 1.9.3 does something similar and that's far more widely used than raindrops is.
2011-06-27doc: librelist.com => librelist.org
A non-profit TLD makes more sense for a Free Software project.
2011-06-24remove _XOPEN_SOURCE #define for FreeBSD
This appears to cause __BSD_VISIBLE to not be defined, which is required for MAP_ANON to be visible in sys/mman.h Thanks for Aleksandar Simic for the hint and Troex Nevelin for the bug report!
2011-06-16linux_inet_diag: avoid pointer aliasing warnings
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.
2011-03-21tcp_info: mark this as Linux-only
We can't even pull in linux/*.h headers to check for TCP_INFO.
2011-03-21extconf: use dir_config properly
dir_config may be used to build for libatomic_ops. The previous use of dir_config was from back when I didn't understand mkmf. This means you can now use: gem install raindrops -- --with-atomic_ops-dir=/usr/local If you libatomic_ops library was installed in /usr/local instead of /usr
2011-03-21inet_diag: no need to rely on sin6_addr internals
Seems to breaks under newer libc headers (on Debian sid).
2011-03-21extconf: remove check for rb_struct_alloc_noinit()
We no longer use it.
2011-03-21inet_diag: fix build under MRI 1.8.7
2011-03-21inet_diag: FD_CLOEXEC for inet_diag sockets by default
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.
2011-03-21inet_diag: use rb_thread_io_blocking_region under 1.9.3dev
It can detect cross-thread close() calls
2011-03-17inet_diag: properly deal with INADDR_ANY binds
Oops :x This was totally broken with the all-listener filter.
2011-03-16doc: fix documentation for Raindrops::InetDiagSocket class
2011-03-12inet_diag: switch to inet_pton() for translation
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.
2011-03-12allow reusing netlink socket for inet_diag
No need to waste resources on creating/destroying a socket.
2011-03-12inet_diag: fix signedness warnings on 32-bit
I thought my compiler would be smarter :<
2011-03-12inet_diag: no need to specify family
The way we dump, we dump it all, it seems.
2011-03-12inet_diag: fix up IPv6 address stringification
This means we can read multiple addresses at once, even IPv6 ones.
2011-03-12inet_diag: fall back on IPv6 lookups
It's slow, but at least it works.
2011-03-12inet_diag: fold all_tcp_listener_stats into tcp_listener_stats
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.
2011-03-12inet_diag: small reorganization
2011-03-12inet_diag: do not set unblocking function
netlink is fast and predictable in response times, so permitting interrupts would just complicate things and lead to errors.
2011-03-12move st_table cleanup
Fewer places to check for errors, we think.
2011-03-12inet_diag: stricter IPv6 address parsing
Be stricter about invalid inputs.
2011-03-11linux: method for dumping all TCP listener stats
This is a work-in-progress and will probably be modified before the next release.
2011-03-11inet_diag: force the use of 32-bit counters
64-bit counters are unnecessarily large for tracking active or queued connections until we have IP_ROFLSCALE support :>
2011-03-11inet_diag: fixup braindamage from refactoring
Oops :x
2011-03-11cleanup struct initialization to avoid ifdefs
Too hard to maintain.
2011-03-11use unsigned values for all counters
We can't have negative values
2011-03-11inet_diag: cleanup unnecessarily large struct
We don't care for this address.
2011-03-11inet_diag: fixup broken assertion
Oops, strings are always true :x
2011-03-11inet_diag: factor out prep code
We're going to experiment with something...
2011-03-11tcp_info: more documentation on last_data_recv
It's useful, yes.
2011-03-10fix stupid typo in Raindrops#size=
Oops, it could give the GC problems.
2011-03-11support for Raindrops#size= and Raindrops#evaporate!
This allows limited resizing of the Raindrops memory area since we always over-allocate due to the required page aligment for mmap. It would be nice if mremap() worked with MAP_SHARED, but it does not and triggers a bus error when attempting to access the new area. ref: https://bugzilla.kernel.org/show_bug.cgi?id=8691
2011-03-10rdoc: 100% documentation coverage!
Of course, RDoc doesn't know quantity vs quality :)
2011-03-01use struct tcp_info from linux/tcp.h
It's more complete for people on ancient systems where "struct tcp_info" is defined in netinet/tcp and missing tcp_ircv_rtt, tcpi_rcv_space and tcpi_total_retrans.
2011-02-23add Raindrops::MAX constant
This is the highest number a counter may be incremented to before it overflows.
2011-02-23linux: add support for TCP_INFO reporting
This returns a Raindrops::TCP_Info object that wraps a tcp_info struct.
2011-02-23split out RSTRUCT* compat macros
We might reuse that for other code...
2011-02-23use autoload for Linux module
We'll be doing more Linux-only stuff
2011-02-15linux: add ipv6 support for inet_diag
inet_diag already supports AF_INET6.
2011-02-11addrs are always an Array of Strings
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-09-25force -march=i486 where GCC is targeted for i386
Nobody uses i386 anymore (especially not with Ruby!), but some systems like FreeBSD 7.0 still target GCC at i386 by default, so we force GCC to use a slightly more modern instruction set and allow it to use atomic builtins.