This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [PATCH] tapset to count number open file handlers and max file handlers for a process


Srinivasa Ds <srinivasa@in.ibm.com> writes:

>   I have developed a small tapset that caluculates number of opened file
> handlers for a process as well as maximum file hanlders for a
> process.

There is at least one problem: all the pointer dereferences are
unprotected.  Please use kread() for every link in the pointer chain,
in anticipation that every pointer might be corrupt.

A lesser problem is that the code does not even try to acquire any
locks on the file descriptor table, so it could be modified on another
CPU while this one is reading it.  I see some signs of RCU being used,
so maybe this is not too bad, but a comment explaining the hazards
would be nice.

Finally, for a real check-in, one would need documentation in stapfuncs
and at least a buildok item in the test suite.

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]