Sponsored Content
Full Discussion: sar
Special Forums Hardware Filesystems, Disks and Memory sar Post 31487 by kevinb on Friday 8th of November 2002 09:47:06 AM
Old 11-08-2002
It is running on an Risc 6000 AIX 4.3.3 and the 12 totals add up to 100 and not 1200. I know this because I have monitoring tools that clearly show the totals being at 100 not 1200
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sar and inedt

I am the newest of newbies. Please excuse my ignorance. I have come across these two executables, sar and inedt, and am unfamiliar with their function. I have searched my limited resource library and would appreciate any insight available. Rgds, Ren (7 Replies)
Discussion started by: Ren
7 Replies

2. AIX

sar problem

when i used sar -u -f xxxx i've got the result like the following ... 18Aug200614:45:00 0 1 0 99 18Aug200614:50:00 1 1 0 98 18Aug200622:42:46 1 0 0 98 18Aug200607:00:00 0 0 100 0 18Aug200608:20:48 ... (0 Replies)
Discussion started by: pohnpohnpohn
0 Replies

3. HP-UX

Sar

Hey guys in sar -v 5 5 command what is the proc means. (1 Reply)
Discussion started by: sbn
1 Replies

4. Solaris

sar tool

Hi All, I have come through this very nice tool which stores the week performance stats in solaris, but its only stores the stats for 8 in the morning to 5 in the evening. i want to extend the facility to work 24 hrs . Does anyone know how to do that? Thanks in advance (1 Reply)
Discussion started by: azs0309
1 Replies

5. AIX

sar

I am trying to set up sar on my AIX server. We have been running sar and getting reports on out Linux boxes in the past but would like to try to do the same in AIX. On my Linux i have a sar.sh that looks like this: #!/bin/bash LC_ALL=C sar -A -f /var/log/sa/sa27 > /server023.txt LC_ALL=C sar -A... (1 Reply)
Discussion started by: seacros
1 Replies

6. Solaris

Sar Issue

Dear All, I had added these lines in crontab. 0 * * * 0-6 /usr/lib/sa/sa1 00,15,30,45 * * * 0-6 /usr/lib/sa/sa1 5 18 * * 0-6 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A After adding these lines I have to get sar file. But here I am not getting any files in /var/adm/sa directory in one... (2 Replies)
Discussion started by: lbreddy
2 Replies

7. AIX

SAR

I am running below script to display last 48 hour data but the output is not displaying heading - AIX eqrdb26u1 1 6 00CFD5E34C00 01/21/10 System configuration: lcpu=8 ent=2.00 mode=Uncapped 22:31:40 %usr %sys %wio %idle physc %entc and footer - Average 25 9 ... (1 Reply)
Discussion started by: noorm
1 Replies

8. Solaris

sar output

One of my servers giving all zero sar output. Could anyone explain this behaviour. Thanks CHaandana Sample: 10:43:37 %usr %sys %wio %idle 16:15:01 2 1 0 97 16:20:02 2 1 0 97 16:25:02 2 1 0 97 16:30:01 ... (3 Replies)
Discussion started by: chaandana
3 Replies

9. Shell Programming and Scripting

Mpstat and sar

HI I ma using mpstat and sar commands to check the cpu utilisation but the results are not matching .I dont understand why thisis happening? $ sar -u 12 5 Linux 2.6.9-89.35.1.ELhugemem (abcd.efgh.com) 03/07/2013 02:43:16 AM CPU %user %nice %system %iowait %idle... (1 Reply)
Discussion started by: ptappeta
1 Replies

10. UNIX for Advanced & Expert Users

Sar during a test

Hi All, I am trying to run sar on a Redhat server during a test I am performing for a couple of hours. I would like to get the sar metrics for every second (instead of the regularly set up 10 minute interval in the cron). What is the most efficient way to do this? Thanks, Shahzad (6 Replies)
Discussion started by: sleo
6 Replies
pmccabe(1)						      General Commands Manual							pmccabe(1)

NAME
pmccabe - calculate McCabe cyclomatic complexity or non-commented line counts for C and C++ programs SYNOPSIS
pmccabe [-bCdfFntTvV?] [file(s)] DESCRIPTION
pmccabe processes the named files, or standard input if none are named. In default mode it calculates statistics including McCabe cyclo- matic complexity for each function. The files are expected to be either C (ANSI or K&R) or C++. -? Print an informative usage message. -v Print column headers -V Print pmccabe version number De-commenting mode -d Intended to help count non-commented source lines via something like: pmccabe -d *.c | grep -v '^[<blank><tab>]*$' | wc -l Comments are removed, cpp directives are replaced by cpp, string literals are replaced by STRINGLITERAL, character constants are replaced by CHARLITERAL. The resulting source code is much easier to parse. This is the first step performed by pmccabe so that its parser can be simpler. None of the other options work sensibly with -d. Line-counting mode -n Counts non-commented source lines. The output format is identical to that of the anac program except that column headers and totals must be requested if desired. If you want column headers add -v. If you want totals add -t. If all you want is totals add -T. Complexity mode (default) -C Custom output format - don't use it. -c Report non-commented, non-blank lines per function (and file) instead of the raw number of lines. Note that pre-processor direc- tives are NOT counted. -b Output format compatible with compiler error browsing tools which understand "classic" compiler errors. Numerical sorting on this format is possible using: sort -n +1 -t% -t Print column totals. Note the total number of lines is *NOT* the number of non-commented source lines - it's the same as would be reported by "wc -l". -T Print column totals *ONLY*. -f Include per-file totals along with the per-function totals. -F Print per-file totals but NOT per-function totals. Parsing pmccabe ignores all cpp preprocessor directives - calculating the complexity of the appearance of the code rather than the complexity after the preprocessor mangles the code. This is especially important since simple things like getchar(3) expand into macros which increase com- plexity. Output Format A line is written to standard output for each function found of the form: Modified McCabe Cyclomatic Complexity | Traditional McCabe Cyclomatic Complexity | | # Statements in function | | | First line of function | | | | # lines in function | | | | | filename(definition line number):function | | | | | | 5 6 11 34 27 gettoken.c(35): matchparen Column 1 contains cyclomatic complexity calculated by adding 1 (for the function) to the occurences of for, if, while, switch, &&, ||, and ?. Unlike "normal" McCabe cyclomatic complexity, each case in a switch statement is not counted as additional complexity. This treatment of switch statements and complexity may be more useful than the "normal" measure for judging maintenance effort and code difficulty. Column 2 is the cyclomatic complexity calculated in the "usual" way with regard to switch statements. Specifically it is calculated as in column 1 but counting each case rather than the switch and may be more useful than column 1 for judging testing effort. Column 3 contains a statement count. It is calculated by adding each occurence of for, if, while, switch, ?, and semicolon within the function. One possible surprise is that for statements have a minimum statement count of 3. This is realistic since for(A; B; C){...} is really shorthand for A; while (B) { ... C;}. The number of statements within a file is the sum of the number of statements for each func- tion implemented within that file, plus one for each of those functions (because functions are statements too), plus one for each other file-scoped statement (usually declarations). Column 4 contains the first line number in the function. This is not necessarily the same line on which the function name appears. Column 5 is the number of lines of the function, from the number in column 4 through the line containing the closing curly brace. The final column contains the file name, line number on which the function name occurs, and the name of the function. APPLICATIONS
The obvious application of pmccabe is illustrated by the following which gives a list of the "top ten" most complex functions: pmccabe *.c | sort -nr | head -10 Many files contain more than one C function and sometimes it would be useful to extract each function separately. matchparen() (see exam- ple output above) can be extracted from gettoken.c by extracting 27 lines starting with line 34. This can form the basis of tools which operate on functions instead of files (e.g., use as a front-end for diff(1)). DIAGNOSTICS
pmccabe returns a nonzero exit status if files could not be opened and upon encountering some parsing errors. Error messages to standard error, usually explaining that the parser is confused about something, mimic classic C compiler error messages. WARNINGS
pmccabe is confused by unmatched curly braces or parentheses which sometimes occur with hasty use of cpp directives. In these cases a diagnostic is printed and the complexity results for the files named may be unreliable. Most times the "#ifdef" directives may be modified such that the curly braces match. Note that if pmccabe is confused by a cpp directive, most pretty printers will be too. In some cases, preprocessing with unifdef(1) may be appropriate. Statement counting could arguably be improved by: counting occurences of the comma operator, multiple assignments, assignments within con- ditional tests, and logical conjunction. However since there is no crisp statement definition from the language or from people I've queried, statement counting will probably not be improved. If you have a crisp definition I'll be happy to consider it. Templates cause pmccabe's scanner to exit. It's a shame that ctags output isn't provided. AUTHOR
Paul Bame SEE ALSO
codechanges(1), decomment(1), vifn(1), sort(1), diff(1), wc(1), grep(1), unifdef(1), head(1), anac(1) http://parisc-linux.org/~bame/pmccabe/ HP
12Feb2003 pmccabe(1)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy