Re: [RFC PATCH 0/6] Add a tool for using the new sysfs files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 6/8/21 1:46 PM, schumaker.anna@xxxxxxxxx wrote:
From: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>

These patches implement a tool that can be used to read and write the
sysfs files, with subcommands! They need Olga's most recent patches to
run.

The following subcommands are implemented:
   nfs-sysfs.py rpc-client
   nfs-sysfs.py xprt
   nfs-sysfs.py xprt set
   nfs-sysfs.py xprt-switch
   nfs-sysfs.py xprt-switch set

So you can print out information about every xprt-switch with:
	anna@client % ./nfs-sysfs.py xprt-switch
	switch 0: num_xprts 1, num_active 1, queue_len 0
		xprt 0: local, /var/run/gssproxy.sock
	switch 1: num_xprts 1, num_active 1, queue_len 0
		xprt 1: local, /var/run/rpcbind.sock
	switch 2: num_xprts 4, num_active 4, queue_len 0
		xprt 2: tcp, 192.168.111.188
		xprt 3: tcp, 192.168.111.188
		xprt 5: tcp, 192.168.111.188
		xprt 6: tcp, 192.168.111.188
	switch 3: num_xprts 1, num_active 1, queue_len 0
		xprt 7: tcp, 192.168.111.1
	switch 4: num_xprts 1, num_active 1, queue_len 0
		xprt 4: tcp, 192.168.111.188

And information about each xprt:
	anna@client % ./nfs-sysfs.py xprt
	xprt 0: local, /var/run/gssproxy.sock, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 1: local, /var/run/rpcbind.sock, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 2: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 3: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 4: tcp, 192.168.111.188, state <BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 5: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 6: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	xprt 7: tcp, 192.168.111.1, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0

You can use the `set` subcommand to change the dstaddr of individual xprts:
	anna@client % ./nfs-sysfs.py xprt --id 2
	xprt 2: tcp, 192.168.111.188, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0
	anna@client % sudo ./nfs-sysfs.py xprt set --id 2 --dstaddr server2.nowheycreamery.vm
	xprt 2: tcp, 192.168.111.186, state <CONNECTED,BOUND>, num_reqs 2
		cur_cong 0, cong_win 256, min_num_slots 2, max_num_slots 65536
		binding_q_len 0, sending_q_len 0, pending_q_len 0, backlog_q_len 0

Or for changing the dstaddr of all xprts attached to a switch:
	anna@client % ./nfs-sysfs.py xprt-switch --id 2
	switch 2: num_xprts 4, num_active 4, queue_len 0
		xprt 2: tcp, 192.168.111.188
		xprt 3: tcp, 192.168.111.188
		xprt 5: tcp, 192.168.111.188
		xprt 6: tcp, 192.168.111.188
	anna@client % sudo ./nfs-sysfs.py xprt-switch set --id 2 --dstaddr server2.nowheycreamery.vm
	switch 2: num_xprts 4, num_active 4, queue_len 0
		xprt 2: tcp, 192.168.111.186
		xprt 3: tcp, 192.168.111.186
		xprt 5: tcp, 192.168.111.186
		xprt 6: tcp, 192.168.111.186


I'm sure this needs lots of polish before it's ready for inclusion,
along with needing a Makefile so it can be installed (I've just been
running it out of the nfs-utils/tools/nfs-sysfs/ directory). But it's
still a start, and I wanted to post it before going on New Baby Leave
Part 2 (June 12 - July 11).

What does everybody think?
The first thing that popped in my was is where is the man page,
but this being a developers tool, maybe one is not needed?? (ala pynfs).
Although if its going to be installed from nfs-utils, it would
be nice to have a man page.

The second thing was I was thinking... it would be good if
we could run this command on a kernel dump... to see what was
going on when things crashed...

Nice work!

steved.

Anna


Anna Schumaker (6):
   nfs-sysfs: Add an nfs-sysfs.py tool
   nfs-sysfs.py: Add a command for printing xprt switch information
   nfs-sysfs.py: Add a command for printing individual xprts
   nfs-sysfs.py: Add a command for printing rpc-client information
   nfs-sysfs.py: Add a command for changing xprt dstaddr
   nfs-sysfs.py: Add a command for changing xprt-switch dstaddrs

  tools/nfs-sysfs/client.py    | 27 ++++++++++++++
  tools/nfs-sysfs/nfs-sysfs.py | 23 ++++++++++++
  tools/nfs-sysfs/switch.py    | 51 +++++++++++++++++++++++++++
  tools/nfs-sysfs/sysfs.py     | 28 +++++++++++++++
  tools/nfs-sysfs/xprt.py      | 68 ++++++++++++++++++++++++++++++++++++
  5 files changed, 197 insertions(+)
  create mode 100644 tools/nfs-sysfs/client.py
  create mode 100755 tools/nfs-sysfs/nfs-sysfs.py
  create mode 100644 tools/nfs-sysfs/switch.py
  create mode 100644 tools/nfs-sysfs/sysfs.py
  create mode 100644 tools/nfs-sysfs/xprt.py





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux