HELLO GUYS,
How u all guys doing?Recently I brought a system and installed Red Hat Linux in it. I have also got a network card. My question is can i connect NIC to my system and use it as a client? I really don't want to buy another system.
I want to use this computer/system both as server and... (0 Replies)
Help! I am very stuck!!!
I have to produce a practical implementation of ONC RPC for an assignment and I do not know where to start. I hve done much searching on sun's site but everything is too complicated for someone with my limited knowledge. I only know the very basic unix commands and have... (1 Reply)
hi everyone i m a novice user . just want to know how to use this website and also learn unix from the basics. can any one help me please.... (2 Replies)
Hi,
I am observing a problem wiht my script. I tokk that part and executed from the command prompt. Below is the command the error. CAn any one suggest what should be done here.
if ($cnt -lt $maxcnt) then echo deepu fi
ksh: 0: not found
Thanks in advance (16 Replies)
I really want to get into unix scripting,work with RS6000 -AIX.
How do i get started,what books are good for beginners,i am very desperate
I have no programming background but ready to scrafice all my time in learning .please help.
PLEASE,PLEASE PLEASE ,HELP....
Any advice will realy... (2 Replies)
Heya all Im just reading up on the solaris o/s and have a few questions regarding it:
1) is the solaris of free to use/download? if yes where?
2) Can the solaris o/s be loaded from CD without affectin windows o/s just like linux can?
3) what are the hardware requirements for using... (2 Replies)
Heya all Im just reading up on the solaris o/s and unix and i just have the following qustions
1) is the solaris o/s the same as Unix if not how are they different - i.e. are they different operating systems?
2) Can the Unix be loaded from CD without affectin windows o/s just like linux... (2 Replies)
I am just learning unix and need some help. I am trying to display all of the files I have modified within the last 24 hours and sort them from the most recently modified. I can't figure it out.. I've been using a lot of ls and find commands. Here are some things I've tried:
find . -mtime -1 |... (4 Replies)
My pipe delimited file is coming over with spurious “\” characters
inserted into some alpha fields,
which is causing the records to be split into 2.
Eg Abc|def|10/11\
AAAA|xyz
Lmn|opq|10/11BBBB|xyz
etc etc
I am having to go into vi, then enter / \ to... (5 Replies)
I've literally been handed this assessment for my course and the lecturer is of no help at all he's taught us virtually nothing would anyone be able to show me how the following script should look on Linux -
For this assignment you have to write a Linux Shell Script which will allow a user to... (1 Reply)
Discussion started by: Andy_cyber
1 Replies
LEARN ABOUT CENTOS
pfm_get_event_encoding
LIBPFM(3) Linux Programmer's Manual LIBPFM(3)NAME
pfm_get_event_encoding - get raw event encoding
SYNOPSIS
#include <perfmon/pfmlib.h>
int pfm_get_event_encoding(const char *str,int dfl_plm, char **fstr, int *idx, uint64_t *code, int *count);
DESCRIPTION
This function is used to retrieve the raw event encoding corresponding to the event string in str. The string may contain unit masks and
modifiers. The default privilege level mask is passed in dfl_plm. It may be used depending on the event.
This function is deprecated. It is superseded by pfm_get_os_event_encoding() where the OS is set to PFM_OS_NONE. Encoding is retrieve
through the pfm_pmu_encode_arg_t structure.
The following examples illustrates the transition:
int i, count = 0;
uint64_t *codes;
ret = pfm_get_event_encoding("RETIRED_INSTRUCTIONS", PFM_PLM3, NULL, &codes, &count);
if (ret != PFM_SUCCESS)
err(1", cannot get encoding %s", pfm_strerror(ret));
for(i=0; i < count; i++)
printf("count[%d]=0x%"PRIx64"
", i, codes[i]);
is equivalent to:
pfm_pmu_encode_arg_t arg;
int i;
memset(&arg, 0, sizeof(arg));
arg.size = sizeof(arg);
ret = pfm_get_os_event_encoding("RETIRED_INSTRUCTIONS", PFM_PLM3, PFM_OS_NONE, &arg);
if (ret != PFM_SUCCESS)
err(1", cannot get encoding %s", pfm_strerror(ret));
for(i=0; i < arg.count; i++)
printf("count[%d]=0x%"PRIx64"
", i, arg.codes[i]);
free(arg.codes);
The encoding may take several 64-bit integers. The function can use the array passed in code if the number
of entries passed in count is big enough. However, if both *codes is NULL and count
is 0, the function allocates the memory necessary to store the encoding. It is up to the caller to
eventually free the memory. The number of 64-bit entries in codes is reflected in *count upon
return regardless of whether the codes was allocated or used as is. If the number of 64-bit integers is
greater than one, then the order in which each component is returned is PMU-model specific. Refer to the PMU
specific man page.
The raw encoding means the encoding as mandated by the underlying PMU model. It may not be directly suitable
to pass to a kernel API. You may want to use API-specific library calls to ensure the correct encoding is passed.
If fstr is not NULL, it will point to the fully qualified event string upon succesful return. The string
contains the event name, any umask set, and the value of all the modifiers. It reflects what the encoding will
actually measure. The function allocates the memory to store the string. The caller must eventually free the
string.
Here is a example of how this function could be used:
#include <inttypes.h>
#include <err.h>
#include <perfmon/pfmlib.h>
int main(int argc, char **argv)
{
uint64_t *codes 0;
int count = 0;
int ret;
ret = pfm_initialize();
if (ret != PFMLIB_SUCCESS)
err(1", cannot initialize library %s", pfm_strerror(ret));
ret = pfm_get_event_encoding("RETIRED_INSTRUCTIONS", PFM_PLM3, NULL, &codes, &count);
if (ret != PFM_SUCCESS)
err(1", cannot get encoding %s", pfm_strerror(ret));
for(i=0; i < count; i++)
printf("count[%d]=0x%"PRIx64"
", i, codes[i]);
free(codes);
return 0;
}
RETURN
The function returns in *codes the encoding of the event and in *count the number of 64-bit integers to support that encoding. Upon suc-
cess, PFM_SUCCESS is returned otherwise a specific error code is returned.
ERRORS
PFM_ERR_TOOSMALL
The code argument is too small for the encoding.
PFM_ERR_INVAL
The code or count argument is NULL.
PFM_ERR_NOMEM
Not enough memory.
PFM_ERR_NOTFOUND
Event not found.
PFM_ERR_ATTR
Invalid event attribute (unit mask or modifier)
PFM_ERR_ATTR_VAL
Invalid modifier value.
PFM_ERR_ATTR_SET
attribute already set, cannot be changed.
PFM_ERR_ATTR_UMASK
Missing unit mask.
PFM_ERR_ATTR_FEATCOMB
Unit masks or features cannot be combined into a single event.
AUTHOR
Stephane Eranian <eranian@gmail.com>
SEE ALSO pfm_get_os_event_encoding(3)
September, 2009 LIBPFM(3)