summaryrefslogtreecommitdiff
path: root/ifpps.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-11ifpps: Remove unnecessary memset()Tobias Klauser1-1/+0
stats_avg will be reset to 0 on the first call to stats_top() before displaying any results, thus this memset() is not necessary. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-10ifpps: Remove unecessary whitespaces in mvwprintw() callsTobias Klauser1-8/+8
Remove trailing whitespace where they're not necessary for the background to extend beyond the text. Replace whitespaces needed for tabbing by setting the appropriate format string field width modifiers. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-10ifpps: Reduce default number of top hitter CPUs to 5Tobias Klauser1-2/+2
Since we now also display the average (and in the future possibly also the standard deviation), reduce the default number of CPUs displayed to 5, to keep terminal space usage low. Suggested-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-10ifpps: Calculate and show average values across all CPUsTobias Klauser1-9/+63
Calculate the average for CPU usage, IRQs/t and absolute IRQs across all CPUs (also the ones which are not displayed) and show them below the respective per-CPU values. Mention this fact the man page accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-09all: show git id in --version informationDaniel Borkmann1-3/+4
In order to be able to better track regressions or to give support, let us track the Git id as well in version information. This makes the ``--version'' switch actually useful. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-24ifpps, flowtop: Move ncurses init and end to common moduleTobias Klauser1-21/+2
ncurses (de-)initialization is duplicated across flowtop and ifpps, so move it to an own module and use it from both tools. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-10ifpps: Remove unused 'forks' member from struct ifstatTobias Klauser1-4/+1
We never use or report it anywhere, so remove it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-09ifpps: minor: fix ncurses alignmentDaniel Borkmann1-3/+3
Since we've added '+'/'-' for max/min CPU values, we also need to shift once whitespace to the left to properly align ncurses display again. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-09ifpps: Rename cpu number parameter to stats_top()Tobias Klauser1-2/+2
This is not the top number of CPUs but the total number. Rename the variable to not confuse this. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-09ifpps: Report more detailed memory stats and number of total processesTobias Klauser1-10/+88
Instead of just giving the percentage of memory usage, report the total, used, active and inactive memory values. Also report total, free and cached for swap. Instead of reporting the memory in the 'sys' line add two new lines for these reports and use the free space to report the total number of processes. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-09ifpps: Don't calculate diff for stats values not used for relative valuesTobias Klauser1-4/+0
These stats values are not reported anywhere in relative terms, so it makes no sense to calculate the difference for them. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-09ifpps: Don't diff tx_bytes twiceTobias Klauser1-1/+0
It's sufficient to calculate the difference of tx_bytes only once. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-09ifpps: Don't re-initialize stats value index counter in CSV modeTobias Klauser1-1/+1
In case we add new stats values, j might be higher already when entering the loop. As j will have the proper number anyway, there is no point in re-initializing. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-06ifpps: Also display min hitter for IRQsTobias Klauser1-23/+50
Also display the least heavy hitter for the relative and absolute IRQ list. Also check that the number passed with -n is actually 1 or larger. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-06ifpps: Always display the least heavy hitter CPUTobias Klauser1-17/+40
Along with the topmost heavy hitters, we always display the least heavy hitter (unless there's only 1 CPU). This is not influenced by the -n command line parameter, so also display the according additional CPU in the header line. Also update the manpage accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-04xutils: eliminate xutils, move rest to epoll2Daniel Borkmann1-1/+0
Finally eliminate xutils.{c,h} and move the rest to epoll2. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04sig: add signal handling functionsDaniel Borkmann1-0/+1
Add an extra file for signal handling functions. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04link: add link management functionsDaniel Borkmann1-0/+1
Same here as usual, break out link functions from xutils. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: move device management functions out of xutilsDaniel Borkmann1-0/+1
Move those functions out so that they can be more easily maintained in its separate file. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: break out promisc mode functionsDaniel Borkmann1-0/+1
Put them separately for the sake of maintanence. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xio: rename xio to ioops and reduce its includesDaniel Borkmann1-1/+1
Rename xio to ioops (io-ops) and boil its include files down to a minimum. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xio: add ioexact operationsDaniel Borkmann1-5/+1
Break this out so that we only need to have sigint non-static where it is really needed. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04cpus: break out cpu related functions from xutilsDaniel Borkmann1-0/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-02ifpps: Rename variable containing top number of CPUsTobias Klauser1-8/+8
To make it more clear whether we're using the total number of CPUs or the top number (default 10 or specified by user), rename the variable, where the top number is used. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-30ifpps: Allow to select number of top hitter CPUs by command line optionTobias Klauser1-15/+24
Instead of hard-coding the maximum number of top hitter CPUs, allow the user to set it manually using a command line option. The default value (if no command line parameter is specified) remains at 10. Also update the manpage accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-30ifpps: Allocate cpu dependent stats in one placeTobias Klauser1-15/+9
Avoid code duplication by allocating the stats arrays dependent on the number of CPUs in main() rather than screen_main() and term_main(). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-29ifpps: fix segfault in terminal modeDaniel Borkmann1-0/+7
Introduced by commit 0e47d1d5011f ("ifpps: Don't assume a maximum of 32 CPUs"). Also update term_main with initial allocation of CPU data. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29ifpps: Properly zero out allocated statsTobias Klauser1-1/+1
The dynamically allocated members of struct ifstat have an entry for each CPU. Properly consider this when resetting the stats in the STATS_ZERO1 macro. Reported-by: Daniel Borkmann <borkmann@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-29ifpps: support mq devices in /proc/interruptsDaniel Borkmann1-2/+7
/proc/interrupts can have such a structure ... 98: 35 0 2902361 PCI-MSI-X eth1-0 106: 61 11 3841 PCI-MSI-X eth1-1 114: 28 0 61452 PCI-MSI-X eth1-2 122: 24 1586 22 PCI-MSI-X eth1-3 130: 2912 0 337 PCI-MSI-X eth1-4 138: 21 0 28 PCI-MSI-X eth1-5 146: 21 0 56 PCI-MSI-X eth1-6 154: 34 1 1 PCI-MSI-X eth1-7 ... and will not count all IRQs for eth1-*. Thus change it to sum up multiple entries. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29ifpps: also show total number of cpusDaniel Borkmann1-2/+2
Just a minor change to also show the total number of cpus in the headline. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29ifpps: remove unused function snr_to_strDaniel Borkmann1-16/+0
It's not used anywhere anymore, so remove it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27ifpps: Use strtoul() to convert unsigned valueTobias Klauser1-1/+1
The refresh interval can only be positive and is stored in an uint64_t, so use strtoul() to convert it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-27ifpps: minor: minor output formatting adaptionDaniel Borkmann1-2/+2
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27ifpps: fix bug_on trigger when parsing irq numberDaniel Borkmann1-10/+18
When parsing irq numbers on e.g. 24 CPU machines, procfs lines can get very long, so our static temporary buffer size will fail here with: Assertion `!(stats->irq_nr == 0)' failed. So allocate it relative to the CPU number. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27ifpps: beautify output with > 10 cpusDaniel Borkmann1-15/+26
I've tested it on a 24 CPU machine, and it does not look so nice if there's different padding along the lines. This patch fixes it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27ifpps: Add myself to the copyright holders in --version/--helpTobias Klauser1-0/+2
Add my name to the ouput of --version and --help. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-27ifpps: Don't assume a maximum of 32 CPUsTobias Klauser1-30/+158
There are people with machines containing far more than 32 CPUs. In their case ifpps didn't work until now because of a limitation to 32 CPUs. Rework ifpps to support an arbitrary number of CPUs. In order to still remain within the display space, if more than 10 (TOP_CPUS) CPUs are available, only the 10 top hitting (in terms of usr and sys time or irqs respectively) are displayed. Suggested-by: Daniel Borkmann <borkmann@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-25ifpps: Convert mem_free/mem_total members of struct ifstat to uint64_tTobias Klauser1-3/+4
Memory usage can never be negative, so make these members unsigned. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-23make: include build nameDaniel Borkmann1-1/+1
Include long version string into tools when called with --version. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-17ifpps: Add __noreturn attribute to exiting functionsTobias Klauser1-2/+2
Add the __noreturn attribute to all functions which wont return but call die() themselves to exit(). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-15man: trafgen: Minor fixesTobias Klauser1-2/+2
Replace "on default" by "by default", make it a bit more clear what the seed in the -E/--seed option is for and mention exit after display of information on --version and --help. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-03-16ifpps: remove state from enum, since never usedDaniel Borkmann1-2/+1
We do not assign or use this particular state, so just remove it from the enum. We continue anyway in the while loop in that case. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16misc: remove dead/unreachable code from switch statementsDaniel Borkmann1-2/+0
Remove various unreachable sections from the switch statements. This was detected by the coverty scanner. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-15all: import netsniff-ng 0.5.8-rc0 sourceDaniel Borkmann1-0/+949
We decided to get rid of the old Git history and start a new one for several reasons: *) Allow / enforce only high-quality commits (which was not the case for many commits in the history), have a policy that is more close to the one from the Linux kernel. With high quality commits, we mean code that is logically split into commits and commit messages that are signed-off and have a proper subject and message body. We do not allow automatic Github merges anymore, since they are total bullshit. However, we will either cherry-pick your patches or pull them manually. *) The old archive was about ~27MB for no particular good reason. This basically derived from the bad decision that also some PDF files where stored there. From this moment onwards, no binary objects are allowed to be stored in this repository anymore. The old archive is not wiped away from the Internet. You will still be able to find it, e.g. on git.cryptoism.org etc. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>