PMC.TSC(3) BSD Library Functions Manual PMC.TSC(3)NAME
pmc.tsc -- measurements using the i386 timestamp counter
LIBRARY
Performance Counters Library (libpmc, -lpmc)
SYNOPSIS
#include <pmc.h>
DESCRIPTION
In the i386 architecture, the timestamp counter is a monotonically non-decreasing counter that counts processor cycles.
This counter may be selected specifying an event specifier ``tsc'' to pmc_allocate(3). The TSC is a read-only counter that may only be allo-
cated in system-wide counting mode. The ``tsc'' event does not support further event qualifiers.
Multiple processes are allowed to allocate the TSC. Once allocated, the TSC may be read using the pmc_read() function, or by using the RDTSC
instruction.
Event Name Aliases
The alias ``cycles'' maps to the TSC.
SEE ALSO pmc(3), pmc.atom(3), pmc.core(3), pmc.core2(3), pmc.iaf(3), pmc.k7(3), pmc.k8(3), pmc.p4(3), pmc.p5(3), pmc.p6(3), pmc.soft(3), pmclog(3),
hwpmc(4)HISTORY
The pmc library first appeared in FreeBSD 6.0.
AUTHORS
The Performance Counters Library (libpmc, -lpmc) library was written by Joseph Koshy <jkoshy@FreeBSD.org>.
BSD October 4, 2008 BSD
Check Out this Related Man Page
PMC_READ(3) BSD Library Functions Manual PMC_READ(3)NAME
pmc_read, pmc_rw, pmc_write, -- read and write hardware performance counters
LIBRARY
Performance Counters Library (libpmc, -lpmc)
SYNOPSIS
#include <pmc.h>
int
pmc_read(pmc_id_t pmc, pmc_value_t *value);
int
pmc_rw(pmc_id_t pmc, pmc_value_t newvalue, pmc_value_t *oldvaluep);
int
pmc_write(pmc_id_t pmc, pmc_value_t value);
DESCRIPTION
These functions read and write the current value of a PMC.
Function pmc_read() will read the current value of the PMC specified by argument pmc and write it to the location specified by argument
value.
Function pmc_write() will set the current value of the PMC specified by argument pmc to the value specified by argument value.
Function pmc_rw() combines a read and a write into a single atomic operation.
For write operations the PMC should be a quiescent state.
RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the
error.
ERRORS
A call to these functions may fail with the following errors:
[EBUSY] A write operation specified a currently running PMC.
[EINVAL] Argument pmc specified a PMC not in a readable state.
[EINVAL] The PMC specified by argument pmc was not owned by the current process.
SEE ALSO pmc(3), hwpmc(4)BSD November 25, 2007 BSD
Hi, i would like to ask that:
If u need to do something like this:
counter = 1;
so that $($counter) = $1, and when u counter++, $($counter) will become $2. How can we do this? (1 Reply)
In my script i am writing to a counter file the no of processes i had started,
that is each time i start a process, i will increment the content of counter file and also when the process ends i will decrement the content of the file.
after this i do some other activities, by now i want to... (1 Reply)
Hello:
Executing following script i'm getting error:
1=1+1: 0403-058 Assignment requires an lvalue.
It's not assuming the counter but i don't know why.
Some hint?
Thank you very much in advance.
#!/bin/ksh
<path>/tiempos.txt
num_exe=1
TIEMPOS=<path>/tiempos.txt
while ]
do (2 Replies)
Hello Friends,,
I m really a new bee to C programms , please help me with a code..
I found some theads here similar to this but Not able to solve what exactly I want..
suppose I ve txt file as below.
abc.txt
12 23
10 11
131 159
12.2 13.8
Then I want to... (7 Replies)
i am using SCO OpenServer 5
I wan to use bash and have a incrementing counter.
e.g.
#!/bin/bash
counter=1
let "counter+=1"
echo $counter
It says that it does not recognise let
So how should i do it? (5 Replies)
I am new to unix and the following problem is bugging me.:confused:
var1="hello1"
var2="hello2"
var3="hello3"
counter=1
while
do
echo $var$counter
done
the idea here is to display the value of "var" based on the counter.
I am using the korn shell. I used array here but the... (4 Replies)
I have an extractfile (with fields delimited by pipes '|') and I want to prepend a counter based on the below requirements:
- The counter starts at 3.
- The counter increments only if the date (67th field of the extractfile) is different.
Below is what I started off with:
$cnt=2;... (3 Replies)
I'm accessing the TSC register, and using usleep() function to calculate my clock frequency. Basically, I check the current clock, delay for 1 second, and then check the clock again to discover how many clock ticks occur in a second.
The only problem is - my result turns out to be a... (1 Reply)
Hi,
I have to perform the two things;
a) Have to check the previous counter value in the file.
b) After some processess are runned again i have to check the same counter value in the same file.
Here is the file contents.
#File contents of file.txt
CounterValue: 0
Here is the... (2 Replies)
counter=0;
while read line;
do ] && let counter=counter+1; done < input_file.txt
echo $counter
The above code is reading a file line by line and checking whether the filenames mentioned in the file exist or not .
At present the o/p is value of counter
I want to echo out the name of... (5 Replies)
QUESTION: How do I run processes in parallel, so that the counter (in counter.txt) would vary in value (instead of just "0" and "1")? That is, how to not sequentially run inc.sh and dec.sh?
The shared counter (a single number starting as 0) is in a file counter.txt.
counter.sh is (supposed to... (2 Replies)
Hi Experts,
I am a new born trying to start learning UNIX so please be patient.
I have downloaded Free BSD 9.0 Release i386 All recently.Upon extracting it I found four Disc Image File.
FreeBSD-9.0-RELEASE-i386-bootonly
FreeBSD-9.0-RELEASE-i386-disc1
FreeBSD-9.0-RELEASE-i386-dvd1... (1 Reply)
Hi Experts,
I am in need for some help. My competence level on unix is not at all helping me to resolve this. Please help.
My Input for a system command is as under:
Counters are getting pegged each hour. I need to have a difference printed rather than pegged counter values.
Counter... (2 Replies)
Hi all,
I'm using Bash 4.3.8 on an Ubuntu system, and no matter what I try, incrementing a counter won't work. The simplest example would be something like this:
#!/bin/bash
myVar=0
myVar=$((myVar++))
echo myVar
The variable should be 1, but it's always 0. I've tried every increment... (6 Replies)