Commit Graph

5 Commits

Author SHA1 Message Date
Willy Tarreau 2afa42599c DEV: poll: add support for epoll
When called with -e, epoll is used instead of poll. The poller does
very little in this code (just checks for any event without waiting) but
that's sufficient to see return values.
2022-11-25 17:07:22 +01:00
Willy Tarreau 35402852bd DEV: poll: indicate the FD's side in front of its value
Some interleaved dumps were hard to follow. By indicating which side
we're talking about it's easier. E.g:

  $ dev/poll/poll -v -s pol,clo -c pol
  #### BEGIN ####
  cmd #1 stp #0: con(c=4): ret=0
  cmd #1 stp #0: acc(l=3): ret=5
  cmd #1 stp #1: pol(s=5): ret=1 ev=0x4 (OUT)
  cmd #1 stp #2: clo(s=5): ret=0
  cmd #2 stp #1: pol(c=4): ret=1 ev=0x2005 (IN OUT RDHUP)
2022-11-17 10:56:35 +01:00
Willy Tarreau 05ed7e849c DEV: poll: strip the "do_" prefix from reported function names
This doesn't bring anything and makes the output less readable. Let's
just keep the action name.
2022-11-17 10:56:35 +01:00
Willy Tarreau e61064162b DEV: poll: make the connect() step an action as well
Now the connect() step becomes an action. It's still implicit before
any -c/-s but it allows the listener to close() before connect()
happens, showing the polling status for this condition:

  $ dev/poll/poll -v -l clo -c pol
  #### BEGIN ####
  cmd #1 stp #1: do_clo(3): ret=0
  cmd #2 stp #0: do_con(4): ret=-1 (Connection refused)
  cmd #2 stp #1: do_pol(4): ret=1 ev=0x14 (OUT HUP)
  #### END ####

which differs from a case where the server closes the just accepted
connection:

  $ dev/poll/poll -v -s clo -c pol
  #### BEGIN ####
  cmd #1 stp #0: do_con(4): ret=0
  cmd #1 stp #0: do_acc(3): ret=5
  cmd #1 stp #1: do_clo(5): ret=0
  cmd #2 stp #1: do_pol(4): ret=1 ev=0x2005 (IN OUT RDHUP)
  #### END ####

It's interesting to see OUT+HUP since HUP indicates that both directions
were closed, hence nothing may be written now, thus OUT just wants the
write handler to be notified.
2022-11-17 10:56:35 +01:00
Willy Tarreau 074ebcde29 CONTRIB: move some dev-specific tools to dev/
The following directories were moved from contrib/ to dev/ to make their
use case a bit clearer. In short, only developers are expected to ever
go there. The makefile was updated to build and clean from these ones.

base64/  flags/  hpack/  plug_qdisc/  poll/  tcploop/  trace/
2021-04-02 17:48:42 +02:00