|
From: Maynard J. <may...@us...> - 2008-07-29 18:57:10
|
Jason Yeh wrote:
> This patch contains the rest of daemon changes to data structures to store and write
> IBS events to sample file, and new stats counting number of IBS samples.
>
Jason,
Sorry it took me so long to respond to this. I'll do my best to reply
to the other patches in this set this week.
A couple general comments about this patch: Several lines are longer
than 80 chars. check_style.py (with -l option) will catch these. Also,
watch for extra spaces at the end of lines.
>
> Signed-off-by: Jason Yeh <jas...@am...>
> ---
> daemon/Makefile.am | 3
> oprofile-ibs/daemon/liblegacy/opd_proc.c | 2
> oprofile-ibs/daemon/liblegacy/opd_sample_files.c | 10 +-
> oprofile-ibs/daemon/opd_events.c | 46 +++++++---
> oprofile-ibs/daemon/opd_events.h | 7 -
> oprofile-ibs/daemon/opd_mangling.c | 15 ++-
> oprofile-ibs/daemon/opd_mangling.h | 3
> oprofile-ibs/daemon/opd_printf.h | 2
> oprofile-ibs/daemon/opd_sfile.c | 98 +++++++++++++++++++----
> oprofile-ibs/daemon/opd_sfile.h | 7 +
> oprofile-ibs/daemon/opd_stats.c | 2
> oprofile-ibs/daemon/opd_stats.h | 1
> oprofile-ibs/daemon/oprofiled.c | 11 ++
> oprofile-ibs/daemon/oprofiled.h | 2
> 14 files changed, 162 insertions(+), 47 deletions(-)
>
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/Makefile.am oprofile-ibs/daemon/Makefile.am
> --- oprofile-cvs/daemon/Makefile.am 2008-04-28 16:23:24.000000000 -0500
> +++ oprofile-ibs/daemon/Makefile.am 2008-07-22 11:03:36.000000000 -0500
> @@ -26,7 +26,8 @@ oprofiled_SOURCES = \
> opd_perfmon.c \
> opd_anon.h \
> opd_anon.c \
> - opd_spu.c
> + opd_spu.c \
> + opd_ibs.h
>
Technically, this change should be in patch 2/7.
>
> LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
>
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/liblegacy/opd_proc.c oprofile-ibs/daemon/liblegacy/opd_proc.c
> --- oprofile-cvs/daemon/liblegacy/opd_proc.c 2005-08-17 14:15:41.000000000 -0500
> +++ oprofile-ibs/daemon/liblegacy/opd_proc.c 2008-07-22 11:03:36.000000000 -0500
> @@ -143,7 +143,7 @@ void opd_put_image_sample(struct opd_ima
> sfile = image->sfiles[cpu_number][counter];
> }
>
> - err = odb_update_node(&sfile->sample_file, offset);
> + err = odb_update_node(&sfile->sample_file, offset, 1);
> if (err) {
> fprintf(stderr, "%s\n", strerror(err));
> abort();
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/liblegacy/opd_sample_files.c oprofile-ibs/daemon/liblegacy/opd_sample_files.c
> --- oprofile-cvs/daemon/liblegacy/opd_sample_files.c 2007-05-10 18:42:33.000000000 -0500
> +++ oprofile-ibs/daemon/liblegacy/opd_sample_files.c 2008-07-22 11:11:47.000000000 -0500
> @@ -69,7 +69,7 @@ static char * opd_mangle_filename(struct
> {
> char * mangled;
> struct mangle_values values;
> - struct opd_event * event = find_counter_event(counter);
> + struct opd_event * event = find_counter_event(counter, 0);
>
> values.flags = 0;
> if (image->kernel)
> @@ -142,8 +142,12 @@ retry:
> goto out;
> }
>
> - fill_header(odb_get_data(&sfile->sample_file), counter, 0, 0,
> - image->kernel, 0, 0, 0, image->mtime);
> + fill_header(odb_get_data(&sfile->sample_file), counter,
> + 0, 0,
> + image->kernel, 0,
> + 0, 0,
> + image->mtime, 0);
>
This is a superfluous change.
> +
>
> out:
> free(mangled);
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_events.c oprofile-ibs/daemon/opd_events.c
> --- oprofile-cvs/daemon/opd_events.c 2007-05-10 18:42:32.000000000 -0500
> +++ oprofile-ibs/daemon/opd_events.c 2008-07-22 11:03:36.000000000 -0500
> @@ -13,6 +13,7 @@
>
> #include "opd_events.h"
> #include "opd_printf.h"
> +#include "opd_ibs.h"
> #include "oprofiled.h"
>
> #include "op_string.h"
> @@ -22,13 +23,16 @@
> #include "op_libiberty.h"
> #include "op_hw_config.h"
> #include "op_sample_file.h"
> +#include "op_events.h"
>
> #include <stdlib.h>
> #include <stdio.h>
>
> extern op_cpu cpu_type;
> +extern int ibs_fetch_count;
> +extern int ibs_op_count;
>
> -struct opd_event opd_events[OP_MAX_COUNTERS];
> +struct opd_event opd_events[OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS];
>
Is there any way to avoid having to *always* allocate space for IBS
events? Also, I note that OP_MAX_IBS_COUNTERS is defined as '600' in
patch 2, even though there aren't *really* 600 events. Think about some
way to compress the array of events.
>
> static double cpu_speed;
>
> @@ -91,11 +95,6 @@ void opd_parse_events(char const * event
> return;
> }
>
> - if (!ev || !strlen(ev)) {
> - fprintf(stderr, "oprofiled: no events passed.\n");
> - exit(EXIT_FAILURE);
> - }
>
Why remove this ^^^ ?
> -
> verbprintf(vmisc, "Events: %s\n", ev);
>
> c = ev;
> @@ -125,13 +124,33 @@ void opd_parse_events(char const * event
> }
>
>
> -struct opd_event * find_counter_event(unsigned long counter)
> +struct opd_event * find_counter_event(unsigned long counter, int ibs)
> {
> size_t i;
> -
> - for (i = 0; i < op_nr_counters && opd_events[i].name; ++i) {
> - if (counter == opd_events[i].counter)
> - return &opd_events[i];
> + struct op_event * ibs_lookup_event;
> +
> + /* If IBS is enabled, use events_list to fill appropriate opd_event */
> + if (ibs) {
> + ibs_lookup_event = op_find_event(cpu_type, COUNTER_TO_IBS_EVENT(counter));
> +
> + if (!ibs_lookup_event) {
> + abort();
> + }
> +
> + opd_events[counter].name = op_xstrndup(ibs_lookup_event->name, strlen(ibs_lookup_event->name));
>
> + opd_events[counter].value = COUNTER_TO_IBS_EVENT(counter);
> + opd_events[counter].counter = counter;
> + opd_events[counter].count =
> + IS_IBS_FETCH(COUNTER_TO_IBS_EVENT(counter))?ibs_fetch_count:ibs_op_count;
>
Please put spaces between each component of the above conditional
expression.
> + opd_events[counter].um = 0;
> + opd_events[counter].kernel = 1;
> + opd_events[counter].user = 1;
> + return &opd_events[counter];
> + } else {
> + for (i = 0; i < op_nr_counters && opd_events[i].name; ++i) {
> + if (counter == opd_events[i].counter)
> + return &opd_events[i];
> + }
> }
>
> fprintf(stderr, "Unknown event for counter %lu\n", counter);
> @@ -143,9 +162,10 @@ struct opd_event * find_counter_event(un
> void fill_header(struct opd_header * header, unsigned long counter,
> vma_t anon_start, vma_t cg_to_anon_start,
> int is_kernel, int cg_to_is_kernel,
> - int spu_samples, uint64_t embed_offset, time_t mtime)
> + int spu_samples, uint64_t embed_offset, time_t mtime,
> + int ibs)
>
alignment
> {
> - struct opd_event * event = find_counter_event(counter);
> + struct opd_event * event = find_counter_event(counter, ibs);
>
> memset(header, '\0', sizeof(struct opd_header));
> header->version = OPD_VERSION;
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_events.h oprofile-ibs/daemon/opd_events.h
> --- oprofile-cvs/daemon/opd_events.h 2007-05-10 18:42:32.000000000 -0500
> +++ oprofile-ibs/daemon/opd_events.h 2008-07-22 11:03:36.000000000 -0500
> @@ -34,14 +34,15 @@ extern struct opd_event opd_events[];
> void opd_parse_events(char const * events);
>
> /** Find the event for the given counter */
> -struct opd_event * find_counter_event(unsigned long counter);
> +struct opd_event * find_counter_event(unsigned long counter, int ibs);
>
> struct opd_header;
>
> /** fill the sample file header with event info etc. */
> void fill_header(struct opd_header * header, unsigned long counter,
> - vma_t anon_start, vma_t anon_end,
> + vma_t anon_start, vma_t anon_end,
superfluous change -- extra space at the end of line
>
> int is_kernel, int cg_to_is_kernel,
> - int spu_samples, uint64_t embed_offset, time_t mtime);
> + int spu_samples, uint64_t embed_offset, time_t mtime,
> + int ibs);
>
alignment
>
> #endif /* OPD_EVENTS_H */
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_mangling.c oprofile-ibs/daemon/opd_mangling.c
> --- oprofile-cvs/daemon/opd_mangling.c 2007-05-10 18:42:33.000000000 -0500
> +++ oprofile-ibs/daemon/opd_mangling.c 2008-07-22 11:03:36.000000000 -0500
> @@ -66,11 +66,12 @@ static char * mangle_anon(struct anon_ma
>
>
> static char *
> -mangle_filename(struct sfile * last, struct sfile const * sf, int counter, int cg)
> +mangle_filename(struct sfile * last, struct sfile const * sf, int counter, int cg,
> + int ibs)
> {
> - char * mangled;
> + char * mangled = NULL;
> struct mangle_values values;
> - struct opd_event * event = find_counter_event(counter);
> + struct opd_event * event = find_counter_event(counter, ibs);
>
> values.flags = 0;
>
> @@ -139,7 +140,8 @@ mangle_filename(struct sfile * last, str
>
>
> int opd_open_sample_file(odb_t * file, struct sfile * last,
> - struct sfile * sf, int counter, int cg)
> + struct sfile * sf, int counter, int cg,
> + int ibs)
>
alignment
> {
> char * mangled;
> char const * binary;
> @@ -147,7 +149,7 @@ int opd_open_sample_file(odb_t * file, s
> vma_t last_start = 0;
> int err;
>
> - mangled = mangle_filename(last, sf, counter, cg);
> + mangled = mangle_filename(last, sf, counter, cg, ibs);
>
> if (!mangled)
> return EINVAL;
> @@ -194,7 +196,8 @@ retry:
> sf->anon ? sf->anon->start : 0, last_start,
> !!sf->kernel, last ? !!last->kernel : 0,
> spu_profile, sf->embedded_offset,
> - binary ? op_get_mtime(binary) : 0);
> + (binary ? op_get_mtime(binary) : 0 ),
> + ibs);
>
alignment
>
> out:
> sfile_put(sf);
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_mangling.h oprofile-ibs/daemon/opd_mangling.h
> --- oprofile-cvs/daemon/opd_mangling.h 2004-05-29 11:29:40.000000000 -0500
> +++ oprofile-ibs/daemon/opd_mangling.h 2008-07-22 11:03:36.000000000 -0500
> @@ -28,6 +28,7 @@ struct sfile;
> * Returns 0 on success.
> */
> int opd_open_sample_file(odb_t * file, struct sfile * last,
> - struct sfile * sf, int counter, int cg);
> + struct sfile * sf, int counter, int cg,
> + int ibs);
>
alignment
>
> #endif /* OPD_MANGLING_H */
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_printf.h oprofile-ibs/daemon/opd_printf.h
> --- oprofile-cvs/daemon/opd_printf.h 2004-01-29 14:00:26.000000000 -0600
> +++ oprofile-ibs/daemon/opd_printf.h 2008-07-22 11:03:36.000000000 -0500
> @@ -22,6 +22,8 @@ extern int vsamples;
> extern int varcs;
> /// kernel module handling
> extern int vmodule;
> +/// ibs debuging
> +extern int vibs_debug;
> /// all others not fitting in above category, not voluminous.
> extern int vmisc;
>
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_sfile.c oprofile-ibs/daemon/opd_sfile.c
> --- oprofile-cvs/daemon/opd_sfile.c 2007-05-10 18:42:33.000000000 -0500
> +++ oprofile-ibs/daemon/opd_sfile.c 2008-07-22 14:53:29.000000000 -0500
> @@ -28,6 +28,9 @@
> #define HASH_SIZE 2048
> #define HASH_BITS (HASH_SIZE - 1)
>
> +extern int ibs_fetch_count;
> +extern int ibs_op_count;
> +
> /** All sfiles are hashed into these lists */
> static struct list_head hashes[HASH_SIZE];
>
> @@ -180,7 +183,7 @@ create_sfile(unsigned long hash, struct
> sf->kernel = ki;
> sf->anon = trans->anon;
>
> - for (i = 0 ; i < op_nr_counters ; ++i)
> + for (i = 0 ; i < OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS; ++i)
> odb_init(&sf->files[i]);
>
> for (i = 0; i < CG_HASH_SIZE; ++i)
> @@ -275,7 +278,7 @@ static void sfile_dup(struct sfile * to,
>
> memcpy(to, from, sizeof (struct sfile));
>
> - for (i = 0 ; i < op_nr_counters ; ++i)
> + for (i = 0 ; i < OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS; ++i)
> odb_init(&to->files[i]);
>
> for (i = 0; i < CG_HASH_SIZE; ++i)
> @@ -293,15 +296,22 @@ static odb_t * get_file(struct transient
> struct cg_entry * cg;
> struct list_head * pos;
> unsigned long hash;
> + unsigned long counter = trans->event;
> odb_t * file;
>
> - if (trans->event >= op_nr_counters) {
> - fprintf(stderr, "%s: Invalid counter %lu\n", __FUNCTION__,
> - trans->event);
> - abort();
> + if ((ibs_fetch_count || ibs_op_count) && (trans->ibs_fetch || trans->ibs_op)) {
> + /* Translate IBS event value to counter */
> + counter = IBS_EVENT_TO_COUNTER(counter);
> + } else {
> + /* Disable counter number checking for IBS */
> + if (counter >= op_nr_counters) {
> + fprintf(stderr, "%s: Invalid counter %lu\n", __FUNCTION__,
> + counter);
> + abort();
> + }
> }
>
> - file = &sf->files[trans->event];
> + file = &sf->files[counter];
>
> if (!is_cg)
> goto open;
> @@ -314,7 +324,7 @@ static odb_t * get_file(struct transient
> list_for_each(pos, &sf->cg_hash[hash]) {
> cg = list_entry(pos, struct cg_entry, hash);
> if (sfile_equal(last, &cg->to)) {
> - file = &cg->to.files[trans->event];
> + file = &cg->to.files[counter];
> goto open;
> }
> }
> @@ -322,15 +332,17 @@ static odb_t * get_file(struct transient
> cg = xmalloc(sizeof(struct cg_entry));
> sfile_dup(&cg->to, last);
> list_add(&cg->hash, &sf->cg_hash[hash]);
> - file = &cg->to.files[trans->event];
> + file = &cg->to.files[counter];
>
> open:
> - if (!odb_open_count(file))
> - opd_open_sample_file(file, last, sf, trans->event, is_cg);
> + if (!odb_open_count(file)) {
> + opd_open_sample_file(file, last, sf, counter, is_cg, trans->ibs_fetch || trans->ibs_op);
> + }
>
> /* Error is logged by opd_open_sample_file */
> - if (!odb_open_count(file))
> + if (!odb_open_count(file)) {
> return NULL;
> + }
>
> return file;
> }
> @@ -407,7 +419,7 @@ static void sfile_log_arc(struct transie
> key = to & (0xffffffff);
> key |= ((uint64_t)from) << 32;
>
> - err = odb_update_node(file, key);
> + err = odb_update_node(file, key, 1);
> if (err) {
> fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(err));
> abort();
> @@ -415,6 +427,18 @@ static void sfile_log_arc(struct transie
> }
>
>
> +/*
> + * Function: sfile_log_sample
> + *
> + * This function logs a single event sample. It gets the oprofile database
> + * file using the information in the transient struct trans. It converts
> + * the PC for kernel, anonymous and JIT samples from an absolute address
> + * to an offset. If a file is not found for the sample, the sample is tallied
> + * as a lost sample. Finally, odb_insert() is called to actually insert the
> + * sample into the oprofile database. This function tallies a single
> + * event sample, so the count value passed to odb_insert() is one.
> + *
> + */
> void sfile_log_sample(struct transient const * trans)
> {
> int err;
> @@ -437,7 +461,47 @@ void sfile_log_sample(struct transient c
>
> if (trans->current->anon)
> pc -= trans->current->anon->start;
> -
> +
> + if (vsamples)
> + verbose_sample(trans, pc);
> +
> + if (!file) {
> + opd_stats[OPD_LOST_SAMPLEFILE]++;
> + return;
> + }
> +
> + err = odb_update_node(file, (uint64_t)pc, 1);
> + if (err) {
> + fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(err));
> + abort();
> + }
> +}
> +
> +
> +void sfile_log_sample_count(struct transient const * trans,
> + unsigned long int count)
>
Too much duplication of code between sfile_log_sample and
sfile_log_sample_count. Why not just modify the original function to
handle the extra argument?
> +{
> + int err;
> + vma_t pc = trans->pc;
> + odb_t * file;
> +
> + if (trans->tracing == TRACING_ON) {
> + /* can happen if kernel sample falls through the cracks,
> + * see opd_put_sample() */
> + if (trans->last)
> + sfile_log_arc(trans);
> + return;
> + }
> +
> + file = get_file(trans, 0);
> +
> + /* absolute value -> offset */
> + if (trans->current->kernel)
> + pc -= trans->current->kernel->start;
> +
> + if (trans->current->anon)
> + pc -= trans->current->anon->start;
> +
> if (vsamples)
> verbose_sample(trans, pc);
>
> @@ -446,7 +510,7 @@ void sfile_log_sample(struct transient c
> return;
> }
>
> - err = odb_update_node(file, (uint64_t)pc);
> + err = odb_update_node(file, (odb_key_t)pc, (odb_value_t)count);
> if (err) {
> fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(err));
> abort();
> @@ -459,7 +523,7 @@ static int close_sfile(struct sfile * sf
> size_t i;
>
> /* it's OK to close a non-open odb file */
> - for (i = 0; i < op_nr_counters; ++i)
> + for (i = 0; i < OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS; ++i)
> odb_close(&sf->files[i]);
>
> return 0;
> @@ -478,7 +542,7 @@ static int sync_sfile(struct sfile * sf,
> {
> size_t i;
>
> - for (i = 0; i < op_nr_counters; ++i)
> + for (i = 0; i < OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS; ++i)
> odb_sync(&sf->files[i]);
>
> return 0;
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_sfile.h oprofile-ibs/daemon/opd_sfile.h
> --- oprofile-cvs/daemon/opd_sfile.h 2007-05-10 18:42:33.000000000 -0500
> +++ oprofile-ibs/daemon/opd_sfile.h 2008-07-22 11:03:36.000000000 -0500
> @@ -18,6 +18,7 @@
> #include "op_hw_config.h"
> #include "op_types.h"
> #include "op_list.h"
> +#include "opd_ibs.h"
>
> #include <sys/types.h>
>
> @@ -61,7 +62,7 @@ struct sfile {
> /** true if this file should be ignored in profiles */
> int ignored;
> /** opened sample files */
> - odb_t files[OP_MAX_COUNTERS];
> + odb_t files[OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS];
> /** hash table of opened cg sample files */
> struct list_head cg_hash[CG_HASH_SIZE];
> };
> @@ -107,6 +108,10 @@ struct sfile * sfile_find(struct transie
> /** Log the sample in a previously located sfile. */
> void sfile_log_sample(struct transient const * trans);
>
> +/** Log the event/cycle count in a previously located sfile */
> +void sfile_log_sample_count(struct transient const * trans,
> + unsigned long int count);
> +
> /** initialise hashes */
> void sfile_init(void);
>
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_stats.c oprofile-ibs/daemon/opd_stats.c
> --- oprofile-cvs/daemon/opd_stats.c 2008-06-23 14:52:29.000000000 -0500
> +++ oprofile-ibs/daemon/opd_stats.c 2008-07-22 11:03:36.000000000 -0500
> @@ -18,6 +18,7 @@
> #include <stdlib.h>
> #include <stdio.h>
>
> +
> unsigned long opd_stats[OPD_MAX_STATS];
>
> /**
> @@ -50,6 +51,7 @@ void opd_print_stats(void)
> opd_stats[OPD_LOST_SAMPLEFILE]);
> printf("Nr. samples lost due to no permanent mapping: %lu\n",
> opd_stats[OPD_LOST_NO_MAPPING]);
> + printf("Nr. IBS samples mapped: %lu\n", opd_stats[OPD_IBS_SAMPLE]);
> print_if("Nr. event lost due to buffer overflow: %u\n",
> "/dev/oprofile/stats", "event_lost_overflow", 1);
> print_if("Nr. samples lost due to no mapping: %u\n",
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/opd_stats.h oprofile-ibs/daemon/opd_stats.h
> --- oprofile-cvs/daemon/opd_stats.h 2005-04-23 21:36:53.000000000 -0500
> +++ oprofile-ibs/daemon/opd_stats.h 2008-07-22 11:03:36.000000000 -0500
> @@ -23,6 +23,7 @@ enum { OPD_SAMPLES, /**< nr. samples */
> OPD_LOST_NO_MAPPING, /**< nr samples lost due to no mapping */
> OPD_DUMP_COUNT, /**< nr. of times buffer is read */
> OPD_DANGLING_CODE, /**< nr. partial code notifications (buffer overflow */
> + OPD_IBS_SAMPLE, /**< nr. of IBS samples mapped */
> OPD_MAX_STATS /**< end of stats */
> };
>
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/oprofiled.c oprofile-ibs/daemon/oprofiled.c
> --- oprofile-cvs/daemon/oprofiled.c 2008-04-28 16:23:23.000000000 -0500
> +++ oprofile-ibs/daemon/oprofiled.c 2008-07-22 11:03:36.000000000 -0500
> @@ -30,6 +30,7 @@
> #include "op_lockfile.h"
> #include "op_list.h"
> #include "op_fileio.h"
> +#include "op_events.h"
>
> #include <sys/types.h>
> #include <sys/resource.h>
> @@ -57,6 +58,7 @@ int vsamples;
> int varcs;
> int vmodule;
> int vmisc;
> +int vibs_debug;
> int separate_lib;
> int separate_kernel;
> int separate_thread;
> @@ -64,6 +66,8 @@ int separate_cpu;
> int no_vmlinux;
> char * vmlinux;
> char * kernel_range;
> +int ibs_fetch_count = 0;
> +int ibs_op_count = 0;
> char * session_dir;
> int no_xen;
> char * xenimage;
> @@ -94,6 +98,8 @@ static struct poptOption options[] = {
> { "events", 'e', POPT_ARG_STRING, &events, 0, "events list", "[events]" },
> { "version", 'v', POPT_ARG_NONE, &showvers, 0, "show version", NULL, },
> { "verbose", 'V', POPT_ARG_STRING, &verbose, 0, "be verbose in log file", "all,sfile,arcs,samples,module,misc", },
> + { "ibs-fetch", 'i', POPT_ARG_INT, &ibs_fetch_count, 0, "AMD IBS Fetch mode", "[0 to Max]", },
> + { "ibs-op", 'o', POPT_ARG_INT, &ibs_op_count, 0, "AMD IBS OP mode", "[0 to Max]", },
>
As we've already discussed, the "ibs-*" options will be removed.
> POPT_AUTOHELP
> { NULL, 0, 0, NULL, 0, NULL, NULL, },
> };
> @@ -353,6 +359,7 @@ static void opd_handle_verbose_option(ch
> varcs = 1;
> vmodule = 1;
> vmisc = 1;
> + vibs_debug = 1;
> } else if (!strcmp(name, "sfile")) {
> vsfile = 1;
> } else if (!strcmp(name, "arcs")) {
> @@ -363,6 +370,8 @@ static void opd_handle_verbose_option(ch
> vmodule = 1;
> } else if (!strcmp(name, "misc")) {
> vmisc = 1;
> + } else if (!strcmp(name, "ibs_debug")) {
> + vibs_debug = 1;
> } else {OP_MAX_IBS_COUNTERS
> fprintf(stderr, "unknown verbose options\n");
> exit(EXIT_FAILURE);
> @@ -426,7 +435,7 @@ static void opd_options(int argc, char c
> }
> }
>
> - if (events == NULL) {
> + if (events == NULL && (ibs_fetch_count || ibs_op_count)) {
> fprintf(stderr, "oprofiled: no events specified.\n");
> poptPrintHelp(optcon, stderr, 0);
> exit(EXIT_FAILURE);
> diff -uprN -X /home/jasonyeh/dontdiff oprofile-cvs/daemon/oprofiled.h oprofile-ibs/daemon/oprofiled.h
> --- oprofile-cvs/daemon/oprofiled.h 2008-04-28 16:23:23.000000000 -0500
> +++ oprofile-ibs/daemon/oprofiled.h 2008-07-22 11:03:36.000000000 -0500
> @@ -65,5 +65,7 @@ extern char * kernel_range;
> extern int no_xen;
> extern char * xenimage;
> extern char * xen_range;
> +extern int ibs_fetch;
> +extern int ibs_op;
>
> #endif /* OPROFILED_H */
>
>
>
>
|