08-05-2011
@itkamaraj - yes, that's what I am trying to do. My code do that but the performance is off.
@yazu - will try that. Would that run in aix?
Thanks to both of you.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi There...
I have an application which starts up many different processes under different names and I'm creating a script to tell me which processes are running (approx 30 different processes). To do this, I parse the results of a ps -u $USER.
My question is, will my script be faster if I run... (2 Replies)
Discussion started by: orno
2 Replies
2. Shell Programming and Scripting
My example file is as given below:
conn=1 uid=oracle
conn=2 uid=db2
conn=3 uid=oracle
conn=4 uid=hash
conn=5 uid=skher
conn=6 uid=oracle
conn=7 uid=mpalkar
conn=8 uid=anarke
conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5
conn=2 op=-1 msgId=-1 -... (7 Replies)
Discussion started by: sags007_99
7 Replies
3. HP-UX
we have 30 GB files on our filesystem which we need to copy daily to 25 location on the same machine (but different filesystem).
cp is taking 20 min to do the copy and we have 5 different thread doing the copy.
so in all its taking around 2 hr and we need to reduce it.
Is there any... (9 Replies)
Discussion started by: shipra_31
9 Replies
4. Shell Programming and Scripting
I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column.
Here is the script that works for the maximum value.
awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Discussion started by: ncwxpanther
3 Replies
5. Shell Programming and Scripting
Is there an awk script that can easily perform the following operation?
I have a data file that is in the format of
1944-12,5.6
1945-01,9.8
1945-02,6.7
1945-03,9.3
1945-04,5.9
1945-05,0.7
1945-06,0.0
1945-07,0.0
1945-08,0.0
1945-09,0.0
1945-10,0.2
1945-11,10.5
1945-12,22.3... (3 Replies)
Discussion started by: ncwxpanther
3 Replies
6. Shell Programming and Scripting
Using Awk, how can I achieve the following?
I have set of record numbers, for which, I have to replace the nth field with some values, say spaces.
Eg:
Set of Records : 4,9,10,55,89,etc
I have to change the 8th field of all the above set of records to spaces (10 spaces).
Its a delimited... (1 Reply)
Discussion started by: deepakwins
1 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am new to this forum and this is my first post.
My requirement is like to optimize the time taken to grep the file with 40000 lines.
There are two files FILEA(40000 lines) FILEB(40000 lines).
The requirement is like this, both the file will be in the format below... (11 Replies)
Discussion started by: mad man
11 Replies
8. UNIX for Beginners Questions & Answers
Hi All,
I extracted a file using an awk command like this
awk '{print substr($0,78,5)"," substr($0,59,6) "," substr($0,81,3) "," substr($0,11,7)}' file1 >> OUTPUT
cat OUTPUT
00001,100000,005,0000080
00001,100000,008,0000220
00001,100000,001,0001000
00010,100000,001,0000400
I want... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
LEARN ABOUT OPENSOLARIS
cpc_enable
cpc_enable(3CPC) CPU Performance Counters Library Functions cpc_enable(3CPC)
NAME
cpc_enable, cpc_disable - enable and disable performance counters
SYNOPSIS
cc [ flag... ] file... -lcpc [ library... ]
#include <libcpc.h>
int cpc_enable(cpc_t *cpc);
int cpc_disable(cpc_t *cpc);
DESCRIPTION
In certain applications, it can be useful to explicitly enable and disable performance counters at different times so that the performance
of a critical algorithm can be examined. The cpc_enable() and cpc_disable() functions can be used to enable and disable the performance
counters without otherwise disturbing the invoking LWP's performance hardware configuration.
RETURN VALUES
Upon successful completion, cpc_enable() and cpc_disable() return 0. Otherwise, they return -1 and set errno to indicate the error.
ERRORS
These functions will fail if:
EAGAIN The associated performance counter context has been invalidated by another process.
EINVAL No performance counter context has been created for the calling LWP.
EXAMPLES
Example 1 Use cpc_enable and cpc_disable to minimize code needed by application.
In the following example, the cpc_enable() and cpc_disable() functions are used to minimize the amount of code that needs to be added to
the application. The cputrack(1) command can be used in conjunction with these functions to provide event programming, sampling, and
reporting facilities.
If the application is instrumented in this way and then started by cputrack with the nouser flag set in the event specification, counting
of user events will only be enabled around the critical code section of interest. If the program is run normally, no harm will ensue.
int
main(int argc, char *argv[])
{
cpc_t *cpc = cpc_open(CPC_VER_CURRENT);
/* ... application code ... */
if (cpc != NULL)
(void) cpc_enable(cpc);
/* ==> Code to be measured goes here <== */
if (cpc != NULL)
(void) cpc_disable(cpc);
/* ... other application code */
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
cputrack(1), cpc(3CPC), cpc_open(3CPC), libcpc(3LIB), attributes(5)
SunOS 5.11 31 Jan 2005 cpc_enable(3CPC)