Sponsored Content
Full Discussion: Please Help Me Guys
Top Forums UNIX for Advanced & Expert Users Please Help Me Guys Post 302171853 by vgersh99 on Friday 29th of February 2008 06:34:32 PM
Old 02-29-2008
not sure of what exactly you can assume about your patterns, but...
Code:
echo '2 20080226_18:02:09.749 ISC-Libya Egypt-Cairo2 111 IAM 2913258040 218927157966 b 61 REL f 143 RLC :COMMA:NCI=10,FCI=6101,CPC=0A,TMR=00,OFI=80,USI: :COMMB:: :RELCAUSE:15:' | nawk '{n=split($NF,a, ":");print $3,$4,$9,a[n-1]}'

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

i need your guys help

HI. I just accidently wipe out my hard drive when i installed sun solaris, this is the last thing i remember, it ask me if want to delete the partition table, and i said yes" Im a retard" i thought solaris can't see xp partition table. Could anyone help me recover my data back, is it really... (21 Replies)
Discussion started by: souldier
21 Replies

2. UNIX for Dummies Questions & Answers

Hi again guys

actually i have important question about unix / linux i'm working on visuall basic and visuall c++ i heared from someone that i can't open them while i useing unix / linux is that right? if yes .......... what's the solution if no ............. thanks :) :D :D thanks my friends (1 Reply)
Discussion started by: M_Hafez
1 Replies

3. AIX

Thanks guys

Hi guys, I would like to inform you that I have cleared .... IBM Certified Specialist - p5 and pSeries Administration and Support for AIX 5L V5.3 with 89% thanks to you all. Manu (0 Replies)
Discussion started by: b_manu78
0 Replies

4. Shell Programming and Scripting

Help guys!

Hello Guys, I have written the following script to do certain job. I have more than 300 files, all are .pdb & .out files. and the files are (1,3,5,7,11,13,15,17,21,.......787,791,793,795).pdb /.out . But the way I created the for loop in my script works only one file at a time. But that is not... (2 Replies)
Discussion started by: chuchu
2 Replies

5. UNIX for Advanced & Expert Users

Hi guys...

I want a Bash Shell Script for taking backup of all files created to day and killing all the Process still active of mine at evening every day (1 Reply)
Discussion started by: vinayraj
1 Replies

6. UNIX for Advanced & Expert Users

Please Help Guys Important

Dear All I have an important request: I have a pattern which look like this: 2 20080219_21:43:22.194 ISC-Libya Belgium1 24 IAM 20115139248 218913265641 b 11672 ACM b 20614 CPG b 20619 CPG b 20626 CPG f 33925 REL b 34215 RLC :COMMA: NCI=00,FCI=6001,CPC=0A,TMR=00,USI: :COMMB: BCI=0201:... (15 Replies)
Discussion started by: zanetti321
15 Replies

7. Shell Programming and Scripting

Please help me guys...

Hi All! I need to write a script which reads a file and tries to insert into the DB using those values... file format: var1 var2 var3 var4 var5 var6 Now I want to read from the above file and trying to insert like... insert into table1 values( var1, var2, var3 ); in a loop to... (2 Replies)
Discussion started by: games_icon
2 Replies

8. Cybersecurity

Hey guys

Hey guys, new geek here, sorry I didnt see a intro section. But I do have a question and hope to make my stay here perma. I am interested in IT security, ands I really want to learn, I was hoping for whatever questions I had you guys could lead me through the narrowest path with a broad selection... (1 Reply)
Discussion started by: abeja
1 Replies

9. Shell Programming and Scripting

Help me guys

how to print first line of each repeated 2 fields only if i got files like : USA|Tony|12:25:22:431 USA|John|14:22:42:981 USA|John|08:22:12:349 France|Adam|14:22:42:981 Italy|Tony|18:22:42:212 Italy|Tony|04:22:42:212 Italy|Tony|08:22:42:212 to make output like : ... (9 Replies)
Discussion started by: teefa
9 Replies
cpc_buf_create(3CPC)				    CPU Performance Counters Library Functions				      cpc_buf_create(3CPC)

NAME
cpc_buf_create, cpc_buf_destroy, cpc_set_sample, cpc_buf_get, cpc_buf_set, cpc_buf_hrtime, cpc_buf_tick, cpc_buf_sub, cpc_buf_add, cpc_buf_copy, cpc_buf_zero - sample and manipulate CPC data SYNOPSIS
cc [ flag... ] file... -lcpc [ library... ] #include <libcpc.h> cpc_buf_t *cpc_buf_create(cpc_t *cpc, cpc_set_t *set); int cpc_buf_destroy(cpc_t *cpc, cpc_buf_t *buf); int cpc_set_sample(cpc_t *cpc, cpc_set_t *set, cpc_buf_t *buf); int cpc_buf_get(cpc_t *cpc, cpc_buf_t *buf, int index, uint64_t *val); int cpc_buf_set(cpc_t *cpc, cpc_buf_t *buf, int index, uint64_t val); hrtime_t cpc_buf_hrtime(cpc_t *cpc, cpc_buf_t *buf); uint64_t cpc_buf_tick(cpc_t *cpc, cpc_buf_t *buf); void cpc_buf_sub(cpc_t *cpc, cpc_buf_t *ds, cpc_buf_t *a, cpc_buf_t *b); void cpc_buf_add(cpc_t *cpc, cpc_buf_t *ds, cpc_buf_t *a, cpc_buf_t *b); void cpc_buf_copy(cpc_t *cpc, cpc_buf_t *ds, cpc_buf_t *src); void cpc_buf_zero(cpc_t *cpc, cpc_buf_t *buf); DESCRIPTION
Counter data is sampled into CPC buffers, which are represented by the opaque data type cpc_buf_t. A CPC buffer is created with cpc_buf_create() to hold the data for a specific CPC set. Once a CPC buffer has been created, it can only be used to store and manipulate the data of the CPC set for which it was created. Once a set has been successfully bound, the counter values are sampled using cpc_set_sample(). The cpc_set_sample() function takes a snap- shot of the hardware performance counters counting on behalf of the requests in set and stores the 64-bit virtualized software representa- tions of the counters in the supplied CPC buffer. If a set was bound with cpc_bind_curlwp(3CPC) or cpc_bind_cpu(3CPC), the set can only be sampled by the LWP that bound it. The kernel maintains 64-bit virtual software counters to hold the counts accumulated for each request in the set, thereby allowing applica- tions to count past the limits of the underlying physical counter, which can be significantly smaller than 64 bits. The kernel attempts to maintain the full 64-bit counter values even in the face of physical counter overflow on architectures and processors that can automati- cally detect overflow. If the processor is not capable of overflow detection, the caller must ensure that the counters are sampled often enough to avoid the physical counters wrapping. The events most prone to wrap are those that count processor clock cycles. If such an event is of interest, sampling should occur frequently so that the counter does not wrap between samples. The cpc_buf_get() function retrieves the last sampled value of a particular request in buf. The index argument specifies which request value in the set to retrieve. The index for each request is returned during set configuration by cpc_set_add_request(3CPC). The 64-bit vir- tualized software counter value is stored in the location pointed to by the val argument. The cpc_buf_set() function stores a 64-bit value to a specific request in the supplied buffer. This operation can be useful for performing calculations with CPC buffers, but it does not affect the value of the hardware counter (and thus will not affect the next sample). The cpc_buf_hrtime() function returns a high-resolution timestamp indicating exactly when the set was last sampled by the kernel. The cpc_buf_tick() function returns a 64-bit virtualized cycle counter indicating how long the set has been programmed into the counter since it was bound. The units of the values returned by cpc_buf_tick() are CPU clock cycles. The cpc_buf_sub() function calculates the difference between each request in sets a and b, storing the result in the corresponding request within set ds. More specifically, for each request index n, this function performs ds[n] = a[n] - b[n]. Similarly, cpc_buf_add() adds each request in sets a and b and stores the result in the corresponding request within set ds. The cpc_buf_copy() function copies each value from buffer src into buffer ds. Both buffers must have been created from the same cpc_set_t. The cpc_buf_zero() function sets each request's value in the buffer to zero. The cpc_buf_destroy() function frees all resources associated with the CPC buffer. RETURN VALUES
Upon successful completion, cpc_buf_create() returns a pointer to a CPC buffer which can be used to hold data for the set argument. Other- wise, this function returns NULL and sets errno to indicate the error. Upon successful completion, cpc_set_sample(), cpc_buf_get(), and cpc_buf_set() return 0. Otherwise, they return -1 and set errno to indi- cate the error. ERRORS
These functions will fail if: EINVAL For cpc_set_sample(), the set is not bound, the set and/or CPC buffer were not created with the given cpc handle, or the CPC buffer was not created with the supplied set. EAGAIN When using cpc_set_sample() to sample a CPU-bound set, the LWP has been unbound from the processor it is measuring. ENOMEM The library could not allocate enough memory for its internal data structures. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
cpc_bind_curlwp(3CPC), cpc_set_add_request(3CPC), libcpc(3LIB), attributes(5) NOTES
Often the overhead of performing a system call can be too disruptive to the events being measured. Once a cpc_bind_curlwp(3CPC) call has been issued, it is possible to access directly the performance hardware registers from within the application. If the performance counter context is active, the counters will count on behalf of the current LWP. Not all processors support this type of access. On processors where direct access is not possible, cpc_set_sample() must be used to read the counters. SPARC rd %pic, %rN ! All UltraSPARC wr %rN, %pic ! (All UltraSPARC, but see text) x86 rdpmc ! Pentium II, III, and 4 only If the counter context is not active or has been invalidated, the %pic register (SPARC), and the rdpmc instruction (Pentium) becomes unavailable. Pentium II and III processors support the non-privileged rdpmc instruction that requires that the counter of interest be specified in %ecx and return a 40-bit value in the %edx:%eax register pair. There is no non-privileged access mechanism for Pentium I processors. SunOS 5.10 30 Jan 2004 cpc_buf_create(3CPC)
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy