rpms/oprofile/F-7 oprofile-0.9.1-xen.patch, 1.3, 1.4 oprofile-ppc64-callgraph.patch, 1.1, 1.2 oprofile.spec, 1.52, 1.53
William Eden Cohen (wcohen)
fedora-extras-commits at redhat.com
Mon Aug 13 20:43:57 UTC 2007
Author: wcohen
Update of /cvs/pkgs/rpms/oprofile/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2074
Modified Files:
oprofile-0.9.1-xen.patch oprofile-ppc64-callgraph.patch
oprofile.spec
Log Message:
* Wed Mar 21 2007 Will Cohen <wcohen at redhat.com> - 0.9.2-9
- Tweak xen patch to support newer xenoprof.
oprofile-0.9.1-xen.patch:
Index: oprofile-0.9.1-xen.patch
===================================================================
RCS file: /cvs/pkgs/rpms/oprofile/F-7/oprofile-0.9.1-xen.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- oprofile-0.9.1-xen.patch 22 Sep 2006 18:17:22 -0000 1.3
+++ oprofile-0.9.1-xen.patch 13 Aug 2007 20:43:54 -0000 1.4
@@ -1,6 +1,226 @@
-diff -urN oprofile-0.9.1-xenact/daemon/init.c oprofile-0.9.1-xenpass/daemon/init.c
---- oprofile-0.9.1-xenact/daemon/init.c 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/init.c 2006-09-19 10:39:44.000000000 -0400
+--- oprofile-0.9.2/utils/opcontrol.xen 2006-03-29 16:54:07.000000000 -0500
++++ oprofile-0.9.2/utils/opcontrol 2007-08-13 14:41:29.000000000 -0400
+@@ -143,9 +143,16 @@
+ --cpu-buffer-size=num per-cpu buffer size in units (2.6 only)
+ --note-table-size kernel notes buffer size in notes units (2.4 only)
+
+- --xen Xen image (for Xen only)
+- --active-domains=<list> List of domains in profiling session (for Xen only)
+- (list contains domain ids separated by commas)
++ --xen=file Xen image (for Xen only)
++ --active-domains=id[,ids] list of domains in multiple domain profiling session (Xen)
++ (detailed profiling of user level and kernel modules code)
++ (requires running oprofile on these domains)
++ --passive-domains=id[,ids] list of domains to be profiled (Xen).
++ or --domains=id[,ids] (coarse profiling of user level and kernel modules code)
++ (no need to run oprofile on these domains)
++ --passive-images=file[,files] list of kernel images associated with each passive domain
++ or
++ --domain-images=file[,files]
+ " >&2
+ }
+
+@@ -263,6 +270,9 @@
+ SETUP_DIR="/root/.oprofile"
+ SETUP_FILE="$SETUP_DIR/daemonrc"
+
++ # location for passing info about passive domains to daemon
++ PASSIVE_SETUP_FILE="$SETUP_DIR/xendomain.setup"
++
+ CPUTYPE=`cat $MOUNT/cpu_type`
+ OP_COUNTERS=`ls $MOUNT/ | grep "^[0-9]\+\$" | tr "\n" " "`
+ NR_CHOSEN=0
+@@ -396,7 +406,7 @@
+ }
+
+
+-check_valid_args()
++check_valid_vmlinux()
+ {
+ if test -z "$VMLINUX"; then
+ echo "No vmlinux file specified. You must specify the correct vmlinux file, e.g." >&2
+@@ -417,8 +427,12 @@
+
+ echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2
+ exit 1
++}
++
+
+ # similar check for Xen image
++check_valid_xen()
++{
+ if test -f "$XENIMAGE"; then
+ return
+ fi
+@@ -474,6 +488,76 @@
+ fi
+ }
+
++set_passive_domain()
++{
++ DOMAIN_ID=$1
++ FILE_IMAGE=$2
++ XEN_IMAGE=$3
++
++ if test "$FILE_IMAGE" = "none"; then
++ RANGE="0,0"
++ FILE_IMAGE="domain$DOMAIN_ID-kernel"
++ else
++ # Find VMA range for passive domain kernel image
++ range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "`
++ tmp1=`echo $range_info | awk '{print $4}'`
++ tmp_length=`echo $range_info | awk '{print $3}'`
++ tmp2=`objdump -h $FILE_IMAGE --adjust-vma=0x$tmp_length 2>/dev/null | grep " .text " | awk '{print $4}'`
++
++ if test -z "$tmp1" -o -z "$tmp2"; then
++ echo "The specified file $FILE_IMAGE does not seem to be valid" >&2
++ echo "Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)" >&2
++ vecho "found start as \"$tmp1\", end as \"$tmp2\"" >&2
++ exit 1
++ fi
++ RANGE="`echo $tmp1`,`echo $tmp2`"
++ fi
++ echo " $DOMAIN_ID $FILE_IMAGE $RANGE $XEN_IMAGE" >> $PASSIVE_SETUP_FILE
++}
++
++
++set_passive_domain_config()
++{
++
++ create_dir "$SETUP_DIR"
++
++ touch $PASSIVE_SETUP_FILE
++ chmod 644 $PASSIVE_SETUP_FILE
++ >$PASSIVE_SETUP_FILE
++
++ NDOMAINS=`echo "$PASSIVE_DOMAINS" | awk -F',' '{print NF}'`
++
++ if test -n "$PASSIVE_IMAGES"; then
++ NIMAGES=`echo "$PASSIVE_IMAGES" | awk -F',' '{print NF}'`
++ if [ $NDOMAINS != $NIMAGES ]; then
++ echo "# of passive domains and # of passive images doesn't match." >&2
++ do_help
++ exit 1
++ fi
++
++ for (( i=1; i<=$NDOMAINS; i++ )); do
++ ID=`echo "$PASSIVE_DOMAINS" | awk -F"," '{print $'$i'}'`
++ FILE=`echo "$PASSIVE_IMAGES" | awk -F',' '{print $'$i'}'`
++ if test ! -f "$FILE"; then
++ echo "Image $FILE for passive domain $ID not found." >&2
++ return 1
++ fi
++ LNK_KERNEL=/boot/domain$ID-kernel
++ ln -sf $FILE $LNK_KERNEL
++ LNK_XEN=/boot/domain$ID-xen
++ ln -sf $XENIMAGE $LNK_XEN
++ set_passive_domain $ID $LNK_KERNEL $LNK_XEN
++ done
++ else
++ for (( i=1; i<=$NDOMAINS; i++ )); do
++ ID=`echo "$PASSIVE_DOMAINS" | awk -F"," '{print $'$i'}'`
++ LNK_XEN=/boot/domain$ID-xen
++ set_passive_domain $ID none $LNK_XEN
++ done
++
++ fi
++}
++
+
+ # validate --separate= parameters. This function is called with IFS=,
+ # so on each argument is splitted
+@@ -786,6 +870,16 @@
+ ACTIVE_DOMAINS=$val
+ DO_SETUP=yes
+ ;;
++ --passive-domains|--domains)
++ error_if_empty $arg $val
++ PASSIVE_DOMAINS=$val
++ DO_SETUP=yes
++ ;;
++ --passive-images|--domain-images)
++ error_if_empty $arg $val
++ PASSIVE_IMAGES=$val
++ DO_SETUP=yes
++ ;;
+ --note-table-size)
+ error_if_empty $arg $val
+ if test "$KERNEL_SUPPORT" = "yes"; then
+@@ -858,6 +952,16 @@
+ exit 1
+ fi
+ fi
++
++ if test -n "$ACTIVE_DOMAINS" -a "$START_DAEMON" != "yes"; then
++ echo "Option \"--active-domains\" can only be used with option \"-start-daemon\"." >&2
++ exit 1
++ fi
++
++ if test -n "$PASSIVE_DOMAINS" -a "$START_DAEMON" != "yes" -a "$START" != "yes"; then
++ echo "Option \"--passive-domains\" or "--domains" can only be used with option \"--start-daemon\" or \"--start\"." >&2
++ exit 1
++ fi
+ }
+
+
+@@ -1073,6 +1177,15 @@
+ fi
+ fi
+
++ if test -n "$PASSIVE_DOMAINS"; then
++ if test "$KERNEL_SUPPORT" = "yes"; then
++ echo $PASSIVE_DOMAINS >$MOUNT/passive_domains
++ set_passive_domain_config
++ else
++ echo "passive-domains not supported - ignored" >&2
++ fi
++ fi
++
+ if test $NOTE_SIZE != 0; then
+ set_param notesize $NOTE_SIZE
+ fi
+@@ -1166,7 +1279,8 @@
+
+ do_setup
+ do_load_setup
+- check_valid_args
++ check_valid_vmlinux
++ check_valid_xen
+ get_image_range "linux"
+ get_image_range "xen"
+ do_param_setup
+@@ -1193,6 +1307,10 @@
+ OPD_ARGS="$OPD_ARGS --image=$IMAGE_FILTER"
+ fi
+
++ if ! test -z "$PASSIVE_DOMAINS"; then
++ OPD_ARGS="$OPD_ARGS --xen-passive-setup=$PASSIVE_SETUP_FILE"
++ fi
++
+ if test -n "$VERBOSE"; then
+ OPD_ARGS="$OPD_ARGS --verbose=$VERBOSE"
+ fi
+@@ -1403,6 +1521,8 @@
+ move_and_remove $SAMPLES_DIR/current/{root}
+
+ hup_daemon
++
++ rm -f /boot/domain-*-kernel /boot/domain-*-xen
+ }
+
+
+@@ -1433,7 +1553,8 @@
+ fi
+
+ if test "$SETUP" = "yes"; then
+- check_valid_args
++ check_valid_vmlinux
++ check_valid_xen
+ do_save_setup
+ fi
+
+--- oprofile-0.9.2/daemon/init.c.xen 2006-01-16 08:21:08.000000000 -0500
++++ oprofile-0.9.2/daemon/init.c 2007-08-13 14:37:35.000000000 -0400
@@ -226,6 +226,8 @@
opd_create_vmlinux(vmlinux, kernel_range);
@@ -10,21 +230,123 @@
opd_buf_size = opd_read_fs_int("/dev/oprofile/", "buffer_size", 1);
kernel_pointer_size = opd_read_fs_int("/dev/oprofile/", "pointer_size", 1);
-diff -urN oprofile-0.9.1-xenact/daemon/opd_interface.h oprofile-0.9.1-xenpass/daemon/opd_interface.h
---- oprofile-0.9.1-xenact/daemon/opd_interface.h 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_interface.h 2006-09-19 10:39:44.000000000 -0400
-@@ -27,6 +27,7 @@
- /* Code 9 used to be TRACE_END_CODE which is not used anymore */
- /* Code 9 is now considered an unknown escape code */
- #define XEN_ENTER_SWITCH_CODE 10
--#define LAST_CODE 11
-+#define DOMAIN_SWITCH_CODE 11
-+#define LAST_CODE 12
-
- #endif /* OPD_INTERFACE_H */
-diff -urN oprofile-0.9.1-xenact/daemon/opd_kernel.c oprofile-0.9.1-xenpass/daemon/opd_kernel.c
---- oprofile-0.9.1-xenact/daemon/opd_kernel.c 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_kernel.c 2006-09-19 10:39:44.000000000 -0400
+--- oprofile-0.9.2/daemon/opd_kernel.h.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/opd_kernel.h 2007-08-13 14:37:35.000000000 -0400
+@@ -23,8 +23,12 @@
+ /** create the kernel image */
+ void opd_create_vmlinux(char const * name, char const * arg);
+
++/** create Xen image */
+ void opd_create_xen(char const * name, char const * arg);
+
++/** create Xen passive domain images */
++void opd_create_passive(char const *setup_file);
++
+ /** opd_reread_module_info - parse /proc/modules for kernel modules */
+ void opd_reread_module_info(void);
+
+@@ -33,6 +37,7 @@
+ char * name;
+ vma_t start;
+ vma_t end;
++ int id;
+ struct list_head list;
+ };
+
+--- oprofile-0.9.2/daemon/opd_trans.c.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/opd_trans.c 2007-08-13 14:47:20.000000000 -0400
+@@ -27,6 +27,8 @@
+ #include <stdio.h>
+ #include <errno.h>
+
++int32_t current_domain = COORDINATOR_DOMAIN;
++
+ extern size_t kernel_pointer_size;
+
+
+@@ -213,6 +215,9 @@
+ {
+ verbprintf(vmisc, "KERNEL_ENTER_SWITCH to kernel\n");
+ trans->in_kernel = 1;
++ /* if in passive domain mode cpu mode should be incremented */
++ if (current_domain != COORDINATOR_DOMAIN)
++ trans->in_kernel++;
+ clear_trans_current(trans);
+ /* subtlety: we must keep trans->cookie cached,
+ * even though it's meaningless for the kernel -
+@@ -226,6 +231,9 @@
+ {
+ verbprintf(vmisc, "USER_ENTER_SWITCH to user-space\n");
+ trans->in_kernel = 0;
++ /* if in passive domain mode cpu mode should be incremented */
++ if (current_domain != COORDINATOR_DOMAIN)
++ trans->in_kernel++;
+ clear_trans_current(trans);
+ clear_trans_last(trans);
+ }
+@@ -254,17 +262,35 @@
+ static void code_xen_enter(struct transient *trans)
+ {
+ verbprintf(vmisc, "XEN_ENTER_SWITCH to xen\n");
+- trans->in_kernel = 1;
++ trans->in_kernel = 2;
++ /* if in passive domain mode cpu mode should be incremented */
++ if (current_domain != COORDINATOR_DOMAIN)
++ trans->in_kernel++;
+ trans->current = NULL;
+ /* subtlety: we must keep trans->cookie cached, even though it's
+- * meaningless for Xen - we won't necessarily get a cookie switch
+- * on Xen exit. See comments in opd_sfile.c. It seems that we can
+- * get away with in_kernel = 1 as long as we supply the correct
+- * Xen image, and its address range in startup find_kernel_image
+- * is modified to look in the Xen image also
++ * meaningless for Xen - same reason as for kernel
+ */
+ }
+
++static void code_domain_switch(struct transient *trans)
++{
++ /* While processing passive domain samples we ensure (in_kernel!=0)
++ * We do this in order to ignore cookies for passive domain samples
++ * But, we have to remember the kernel value for coordinator domain,
++ * so we do the safe thing: increment when leaving the coordinator
++ * domain and decrement when returning to it
++ */
++ if (current_domain == COORDINATOR_DOMAIN)
++ trans->in_kernel++;
++
++ trans->current = NULL;
++ current_domain = (int32_t) pop_buffer_value(trans);
++
++ /* If returning to coordinator domain restore the kernel value */
++ if (current_domain == COORDINATOR_DOMAIN)
++ trans->in_kernel--;
++}
++
+ typedef void (*handler_t)(struct transient *);
+
+ static handler_t handlers[LAST_CODE + 1] = {
+@@ -280,6 +306,9 @@
+ &code_trace_begin,
+ &code_unknown,
+ &code_xen_enter,
++ &code_unknown,
++ &code_unknown,
++ &code_domain_switch,
+ };
+
+
+--- oprofile-0.9.2/daemon/oprofiled.h.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/oprofiled.h 2007-08-13 14:37:35.000000000 -0400
+@@ -64,5 +64,6 @@
+ extern int no_xen;
+ extern char * xenimage;
+ extern char * xen_range;
++extern char * xen_passive_setup;
+
+ #endif /* OPROFILED_H */
+--- oprofile-0.9.2/daemon/opd_kernel.c.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/opd_kernel.c 2007-08-13 14:37:35.000000000 -0400
@@ -34,6 +34,11 @@
static struct kernel_image xen_image;
@@ -192,151 +514,32 @@
+ return image;
+ }
+ return NULL;
-+ default:
-+ printf("Unexpected error on passive mode: CPU mode is "
-+ "%d for domain %d\n", trans->in_kernel, current_domain);
-+ return NULL;
-+ }
-+
-+
-+ }
-+
-+ if (xen_image.start <= trans->pc && xen_image.end > trans->pc)
-+ return &xen_image;
-+
- if (no_vmlinux)
- return image;
-
-@@ -222,8 +362,5 @@
- return image;
- }
-
-- if (xen_image.start <= trans->pc && xen_image.end > trans->pc)
-- return &xen_image;
--
- return NULL;
- }
-diff -urN oprofile-0.9.1-xenact/daemon/opd_kernel.h oprofile-0.9.1-xenpass/daemon/opd_kernel.h
---- oprofile-0.9.1-xenact/daemon/opd_kernel.h 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_kernel.h 2006-09-19 10:39:44.000000000 -0400
-@@ -23,8 +23,12 @@
- /** create the kernel image */
- void opd_create_vmlinux(char const * name, char const * arg);
-
-+/** create Xen image */
- void opd_create_xen(char const * name, char const * arg);
-
-+/** create Xen passive domain images */
-+void opd_create_passive(char const *setup_file);
-+
- /** opd_reread_module_info - parse /proc/modules for kernel modules */
- void opd_reread_module_info(void);
-
-@@ -33,6 +37,7 @@
- char * name;
- vma_t start;
- vma_t end;
-+ int id;
- struct list_head list;
- };
-
-diff -urN oprofile-0.9.1-xenact/daemon/opd_sfile.c oprofile-0.9.1-xenpass/daemon/opd_sfile.c
---- oprofile-0.9.1-xenact/daemon/opd_sfile.c 2005-05-25 20:00:02.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_sfile.c 2006-09-19 10:39:44.000000000 -0400
-@@ -226,7 +226,7 @@
- }
-
- /* we might need a kernel image start/end to hash on */
-- if (trans->in_kernel) {
-+ else if (trans->in_kernel) {
- ki = find_kernel_image(trans);
- if (!ki) {
- verbprintf(vsamples, "Lost kernel sample %llx\n", trans->pc);
-diff -urN oprofile-0.9.1-xenact/daemon/opd_trans.c oprofile-0.9.1-xenpass/daemon/opd_trans.c
---- oprofile-0.9.1-xenact/daemon/opd_trans.c 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_trans.c 2006-09-19 10:39:44.000000000 -0400
-@@ -27,6 +27,8 @@
- #include <stdio.h>
- #include <errno.h>
-
-+int32_t current_domain = COORDINATOR_DOMAIN;
-+
- extern size_t kernel_pointer_size;
-
-
-@@ -213,6 +215,9 @@
- {
- verbprintf(vmisc, "KERNEL_ENTER_SWITCH to kernel\n");
- trans->in_kernel = 1;
-+ /* if in passive domain mode cpu mode should be incremented */
-+ if (current_domain != COORDINATOR_DOMAIN)
-+ trans->in_kernel++;
- clear_trans_current(trans);
- /* subtlety: we must keep trans->cookie cached,
- * even though it's meaningless for the kernel -
-@@ -226,6 +231,9 @@
- {
- verbprintf(vmisc, "USER_ENTER_SWITCH to user-space\n");
- trans->in_kernel = 0;
-+ /* if in passive domain mode cpu mode should be incremented */
-+ if (current_domain != COORDINATOR_DOMAIN)
-+ trans->in_kernel++;
- clear_trans_current(trans);
- clear_trans_last(trans);
- }
-@@ -254,17 +262,35 @@
- static void code_xen_enter(struct transient *trans)
- {
- verbprintf(vmisc, "XEN_ENTER_SWITCH to xen\n");
-- trans->in_kernel = 1;
-+ trans->in_kernel = 2;
-+ /* if in passive domain mode cpu mode should be incremented */
-+ if (current_domain != COORDINATOR_DOMAIN)
-+ trans->in_kernel++;
- trans->current = NULL;
- /* subtlety: we must keep trans->cookie cached, even though it's
-- * meaningless for Xen - we won't necessarily get a cookie switch
-- * on Xen exit. See comments in opd_sfile.c. It seems that we can
-- * get away with in_kernel = 1 as long as we supply the correct
-- * Xen image, and its address range in startup find_kernel_image
-- * is modified to look in the Xen image also
-+ * meaningless for Xen - same reason as for kernel
- */
- }
-
-+static void code_domain_switch(struct transient *trans)
-+{
-+ /* While processing passive domain samples we ensure (in_kernel!=0)
-+ * We do this in order to ignore cookies for passive domain samples
-+ * But, we have to remember the kernel value for coordinator domain,
-+ * so we do the safe thing: increment when leaving the coordinator
-+ * domain and decrement when returning to it
-+ */
-+ if (current_domain == COORDINATOR_DOMAIN)
-+ trans->in_kernel++;
-+
-+ trans->current = NULL;
-+ current_domain = (int32_t) pop_buffer_value(trans);
-+
-+ /* If returning to coordinator domain restore the kernel value */
-+ if (current_domain == COORDINATOR_DOMAIN)
-+ trans->in_kernel--;
-+}
++ default:
++ printf("Unexpected error on passive mode: CPU mode is "
++ "%d for domain %d\n", trans->in_kernel, current_domain);
++ return NULL;
++ }
++
++
++ }
+
- typedef void (*handler_t)(struct transient *);
-
- static handler_t handlers[LAST_CODE + 1] = {
-@@ -280,6 +306,7 @@
- &code_trace_begin,
- &code_unknown,
- &code_xen_enter,
-+ &code_domain_switch,
- };
++ if (xen_image.start <= trans->pc && xen_image.end > trans->pc)
++ return &xen_image;
++
+ if (no_vmlinux)
+ return image;
+@@ -222,8 +362,5 @@
+ return image;
+ }
-diff -urN oprofile-0.9.1-xenact/daemon/opd_trans.h oprofile-0.9.1-xenpass/daemon/opd_trans.h
---- oprofile-0.9.1-xenact/daemon/opd_trans.h 2005-05-02 11:06:59.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/opd_trans.h 2006-09-19 10:39:44.000000000 -0400
+- if (xen_image.start <= trans->pc && xen_image.end > trans->pc)
+- return &xen_image;
+-
+ return NULL;
+ }
+--- oprofile-0.9.2/daemon/opd_trans.h.xen 2005-05-02 11:06:59.000000000 -0400
++++ oprofile-0.9.2/daemon/opd_trans.h 2007-08-13 14:37:35.000000000 -0400
@@ -15,6 +15,10 @@
#include "opd_cookie.h"
#include "op_types.h"
@@ -348,9 +551,19 @@
struct sfile;
struct anon_mapping;
-diff -urN oprofile-0.9.1-xenact/daemon/oprofiled.c oprofile-0.9.1-xenpass/daemon/oprofiled.c
---- oprofile-0.9.1-xenact/daemon/oprofiled.c 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/oprofiled.c 2006-09-19 10:39:44.000000000 -0400
+--- oprofile-0.9.2/daemon/opd_interface.h.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/opd_interface.h 2007-08-13 14:43:13.000000000 -0400
+@@ -27,6 +27,7 @@
+ /* Code 9 used to be TRACE_END_CODE which is not used anymore */
+ /* Code 9 is now considered an unknown escape code */
+ #define XEN_ENTER_SWITCH_CODE 10
+-#define LAST_CODE 11
++#define DOMAIN_SWITCH_CODE 13
++#define LAST_CODE 14
+
+ #endif /* OPD_INTERFACE_H */
+--- oprofile-0.9.2/daemon/oprofiled.c.xen 2006-01-16 08:21:09.000000000 -0500
++++ oprofile-0.9.2/daemon/oprofiled.c 2007-08-13 14:37:35.000000000 -0400
@@ -66,6 +66,7 @@
int no_xen;
char * xenimage;
@@ -367,30 +580,28 @@
{ "separate-lib", 0, POPT_ARG_INT, &separate_lib, 0, "separate library samples for each distinct application", "[0|1]", },
{ "separate-kernel", 0, POPT_ARG_INT, &separate_kernel, 0, "separate kernel samples for each distinct application", "[0|1]", },
{ "separate-thread", 0, POPT_ARG_INT, &separate_thread, 0, "thread-profiling mode", "[0|1]" },
-diff -urN oprofile-0.9.1-xenact/daemon/oprofiled.h oprofile-0.9.1-xenpass/daemon/oprofiled.h
---- oprofile-0.9.1-xenact/daemon/oprofiled.h 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/daemon/oprofiled.h 2006-09-19 10:39:44.000000000 -0400
-@@ -64,5 +64,6 @@
- extern int no_xen;
- extern char * xenimage;
- extern char * xen_range;
-+extern char * xen_passive_setup;
+--- oprofile-0.9.2/daemon/opd_sfile.c.xen 2006-03-19 13:58:22.000000000 -0500
++++ oprofile-0.9.2/daemon/opd_sfile.c 2007-08-13 14:37:35.000000000 -0400
+@@ -226,7 +226,7 @@
+ }
- #endif /* OPROFILED_H */
-diff -urN oprofile-0.9.1-xenact/doc/opcontrol.1.in oprofile-0.9.1-xenpass/doc/opcontrol.1.in
---- oprofile-0.9.1-xenact/doc/opcontrol.1.in 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/doc/opcontrol.1.in 2006-09-19 10:39:44.000000000 -0400
-@@ -105,7 +105,8 @@
- .BI "--callgraph=#depth"
+ /* we might need a kernel image start/end to hash on */
+- if (trans->in_kernel) {
++ else if (trans->in_kernel) {
+ ki = find_kernel_image(trans);
+ if (!ki) {
+ verbprintf(vsamples, "Lost kernel sample %llx\n", trans->pc);
+--- oprofile-0.9.2/doc/opcontrol.1.in.xen 2006-01-16 08:29:23.000000000 -0500
++++ oprofile-0.9.2/doc/opcontrol.1.in 2007-08-13 14:47:19.000000000 -0400
+@@ -113,6 +113,7 @@
Enable callgraph sample collection with a maximum depth. Use 0 to disable
callgraph profiling. This option is currently only usable on x86, using a
--2.6+ kernel with callgraph support enabled.
-+2.6+ kernel with callgraph support enabled. This option is not yet supported
-+on Xen.
+ 2.6+ kernel with callgraph support enabled.
++This option is not yet supported on Xen.
.br
.TP
.BI "--image="[name,name...|"all"]
-@@ -136,12 +137,41 @@
+@@ -143,12 +144,41 @@
.br
.TP
.BI "--active-domains="<list>
@@ -434,225 +645,3 @@
.br
.SH ENVIRONMENT
-diff -urN oprofile-0.9.1-xenact/utils/opcontrol oprofile-0.9.1-xenpass/utils/opcontrol
---- oprofile-0.9.1-xenact/utils/opcontrol 2006-09-19 10:39:56.000000000 -0400
-+++ oprofile-0.9.1-xenpass/utils/opcontrol 2006-09-19 10:39:44.000000000 -0400
-@@ -145,9 +145,16 @@
- --cpu-buffer-size=num per-cpu buffer size in units (2.6 only)
- --note-table-size kernel notes buffer size in notes units (2.4 only)
-
-- --xen Xen image (for Xen only)
-- --active-domains=<list> List of domains in profiling session (for Xen only)
-- (list contains domain ids separated by commas)
-+ --xen=file Xen image (for Xen only)
-+ --active-domains=id[,ids] list of domains in multiple domain profiling session (Xen)
-+ (detailed profiling of user level and kernel modules code)
-+ (requires running oprofile on these domains)
-+ --passive-domains=id[,ids] list of domains to be profiled (Xen).
-+ or --domains=id[,ids] (coarse profiling of user level and kernel modules code)
-+ (no need to run oprofile on these domains)
-+ --passive-images=file[,files] list of kernel images associated with each passive domain
-+ or
-+ --domain-images=file[,files]
- " >&2
- }
-
-@@ -264,6 +271,9 @@
- SETUP_DIR="/root/.oprofile"
- SETUP_FILE="$SETUP_DIR/daemonrc"
-
-+ # location for passing info about passive domains to daemon
-+ PASSIVE_SETUP_FILE="$SETUP_DIR/xendomain.setup"
-+
- CPUTYPE=`cat $MOUNT/cpu_type`
- OP_COUNTERS=`ls $MOUNT/ | grep "^[0-9]\+\$" | tr "\n" " "`
- NR_CHOSEN=0
-@@ -369,7 +379,7 @@
- }
-
-
--check_valid_args()
-+check_valid_vmlinux()
- {
- if test -z "$VMLINUX"; then
- echo "No vmlinux file specified. You must specify the correct vmlinux file, e.g." >&2
-@@ -390,8 +400,12 @@
-
- echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2
- exit 1
-+}
-+
-
- # similar check for Xen image
-+check_valid_xen()
-+{
- if test -f "$XENIMAGE"; then
- return
- fi
-@@ -447,6 +461,76 @@
- fi
- }
-
-+set_passive_domain()
-+{
-+ DOMAIN_ID=$1
-+ FILE_IMAGE=$2
-+ XEN_IMAGE=$3
-+
-+ if test "$FILE_IMAGE" = "none"; then
-+ RANGE="0,0"
-+ FILE_IMAGE="domain$DOMAIN_ID-kernel"
-+ else
-+ # Find VMA range for passive domain kernel image
-+ range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "`
-+ tmp1=`echo $range_info | awk '{print $4}'`
-+ tmp_length=`echo $range_info | awk '{print $3}'`
-+ tmp2=`objdump -h $FILE_IMAGE --adjust-vma=0x$tmp_length 2>/dev/null | grep " .text " | awk '{print $4}'`
-+
-+ if test -z "$tmp1" -o -z "$tmp2"; then
-+ echo "The specified file $FILE_IMAGE does not seem to be valid" >&2
-+ echo "Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)" >&2
-+ vecho "found start as \"$tmp1\", end as \"$tmp2\"" >&2
-+ exit 1
-+ fi
-+ RANGE="`echo $tmp1`,`echo $tmp2`"
-+ fi
-+ echo " $DOMAIN_ID $FILE_IMAGE $RANGE $XEN_IMAGE" >> $PASSIVE_SETUP_FILE
-+}
-+
-+
-+set_passive_domain_config()
-+{
-+
-+ create_dir "$SETUP_DIR"
-+
-+ touch $PASSIVE_SETUP_FILE
-+ chmod 644 $PASSIVE_SETUP_FILE
-+ >$PASSIVE_SETUP_FILE
-+
-+ NDOMAINS=`echo "$PASSIVE_DOMAINS" | awk -F',' '{print NF}'`
-+
-+ if test -n "$PASSIVE_IMAGES"; then
-+ NIMAGES=`echo "$PASSIVE_IMAGES" | awk -F',' '{print NF}'`
-+ if [ $NDOMAINS != $NIMAGES ]; then
-+ echo "# of passive domains and # of passive images doesn't match." >&2
-+ do_help
-+ exit 1
-+ fi
-+
-+ for (( i=1; i<=$NDOMAINS; i++ )); do
-+ ID=`echo "$PASSIVE_DOMAINS" | awk -F"," '{print $'$i'}'`
-+ FILE=`echo "$PASSIVE_IMAGES" | awk -F',' '{print $'$i'}'`
-+ if test ! -f "$FILE"; then
-+ echo "Image $FILE for passive domain $ID not found." >&2
-+ return 1
-+ fi
-+ LNK_KERNEL=/boot/domain$ID-kernel
-+ ln -sf $FILE $LNK_KERNEL
-+ LNK_XEN=/boot/domain$ID-xen
-+ ln -sf $XENIMAGE $LNK_XEN
-+ set_passive_domain $ID $LNK_KERNEL $LNK_XEN
-+ done
-+ else
-+ for (( i=1; i<=$NDOMAINS; i++ )); do
-+ ID=`echo "$PASSIVE_DOMAINS" | awk -F"," '{print $'$i'}'`
-+ LNK_XEN=/boot/domain$ID-xen
-+ set_passive_domain $ID none $LNK_XEN
-+ done
-+
-+ fi
-+}
-+
-
- # validate --separate= parameters. This function is called with IFS=,
- # so on each argument is splitted
-@@ -746,6 +830,16 @@
- ACTIVE_DOMAINS=$val
- DO_SETUP=yes
- ;;
-+ --passive-domains|--domains)
-+ error_if_empty $arg $val
-+ PASSIVE_DOMAINS=$val
-+ DO_SETUP=yes
-+ ;;
-+ --passive-images|--domain-images)
-+ error_if_empty $arg $val
-+ PASSIVE_IMAGES=$val
-+ DO_SETUP=yes
-+ ;;
- --note-table-size)
- error_if_empty $arg $val
- if test $"KERNEL_SUPPORT" = "yes"; then
-@@ -818,6 +912,16 @@
- exit 1
- fi
- fi
-+
-+ if test -n "$ACTIVE_DOMAINS" -a "$START_DAEMON" != "yes"; then
-+ echo "Option \"--active-domains\" can only be used with option \"-start-daemon\"." >&2
-+ exit 1
-+ fi
-+
-+ if test -n "$PASSIVE_DOMAINS" -a "$START_DAEMON" != "yes" -a "$START" != "yes"; then
-+ echo "Option \"--passive-domains\" or "--domains" can only be used with option \"--start-daemon\" or \"--start\"." >&2
-+ exit 1
-+ fi
- }
-
-
-@@ -1025,6 +1129,15 @@
- fi
- fi
-
-+ if test -n "$PASSIVE_DOMAINS"; then
-+ if test "$KERNEL_SUPPORT" = "yes"; then
-+ echo $PASSIVE_DOMAINS >$MOUNT/passive_domains
-+ set_passive_domain_config
-+ else
-+ echo "passive-domains not supported - ignored" >&2
-+ fi
-+ fi
-+
- if test $NOTE_SIZE != 0; then
- set_param notesize $NOTE_SIZE
- fi
-@@ -1117,7 +1230,8 @@
-
- do_setup
- do_load_setup
-- check_valid_args
-+ check_valid_vmlinux
-+ check_valid_xen
- get_image_range "linux"
- get_image_range "xen"
- do_param_setup
-@@ -1144,6 +1258,10 @@
- OPD_ARGS="$OPD_ARGS --image=$IMAGE_FILTER"
- fi
-
-+ if ! test -z "$PASSIVE_DOMAINS"; then
-+ OPD_ARGS="$OPD_ARGS --xen-passive-setup=$PASSIVE_SETUP_FILE"
-+ fi
-+
- if test -n "$VERBOSE"; then
- OPD_ARGS="$OPD_ARGS --verbose=$VERBOSE"
- fi
-@@ -1350,6 +1468,8 @@
- move_and_remove $SAMPLES_DIR/current/{root}
-
- hup_daemon
-+
-+ rm -f /boot/domain-*-kernel /boot/domain-*-xen
- }
-
-
-@@ -1380,7 +1500,8 @@
- fi
-
- if test "$SETUP" = "yes"; then
-- check_valid_args
-+ check_valid_vmlinux
-+ check_valid_xen
- do_save_setup
- fi
-
oprofile-ppc64-callgraph.patch:
Index: oprofile-ppc64-callgraph.patch
===================================================================
RCS file: /cvs/pkgs/rpms/oprofile/F-7/oprofile-ppc64-callgraph.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- oprofile-ppc64-callgraph.patch 21 Mar 2007 14:45:55 -0000 1.1
+++ oprofile-ppc64-callgraph.patch 13 Aug 2007 20:43:54 -0000 1.2
@@ -1,12 +1,17 @@
-Index: doc/oprofile.xml
-===================================================================
-RCS file: /cvsroot/oprofile/oprofile/doc/oprofile.xml,v
-retrieving revision 1.153
-retrieving revision 1.154
-diff -u -r1.153 -r1.154
---- doc/oprofile.xml 17 Nov 2006 23:47:29 -0000 1.153
-+++ doc/oprofile.xml 19 Nov 2006 17:24:30 -0000 1.154
-@@ -620,8 +620,15 @@
+--- oprofile-0.9.2/doc/opcontrol.1.in.ppc64doc 2007-08-13 15:52:21.000000000 -0400
++++ oprofile-0.9.2/doc/opcontrol.1.in 2007-08-13 15:54:25.000000000 -0400
+@@ -112,7 +112,7 @@
+ .BI "--callgraph=#depth"
+ Enable callgraph sample collection with a maximum depth. Use 0 to disable
+ callgraph profiling. This option is currently only usable on x86, using a
+-2.6+ kernel with callgraph support enabled.
++2.6+ kernel with callgraph support enabled. It is also available on PowerPC using a 2.6.17+ kernel.
+ This option is not yet supported on Xen.
+ .br
+ .TP
+--- oprofile-0.9.2/doc/oprofile.xml.ppc64doc 2006-01-22 17:02:13.000000000 -0500
++++ oprofile-0.9.2/doc/oprofile.xml 2007-08-13 15:52:21.000000000 -0400
+@@ -608,8 +608,15 @@
<term><option>--callgraph=</option>#depth</term>
<listitem><para>
Enable call-graph sample collection with a maximum depth. Use 0 to disable
@@ -24,24 +29,3 @@
</para></listitem>
</varlistentry>
<varlistentry>
-Index: doc/opcontrol.1.in
-===================================================================
-RCS file: /cvsroot/oprofile/oprofile/doc/opcontrol.1.in,v
-retrieving revision 1.20
-retrieving revision 1.21
-diff -u -r1.20 -r1.21
---- doc/opcontrol.1.in 16 Jan 2006 13:29:23 -0000 1.20
-+++ doc/opcontrol.1.in 13 Oct 2006 19:17:57 -0000 1.21
-@@ -111,9 +111,9 @@
- .TP
- .BI "--callgraph=#depth"
- Enable callgraph sample collection with a maximum depth. Use 0 to disable
--callgraph profiling. This option is currently only usable on x86, using a
--2.6+ kernel with callgraph support enabled. This option is not yet supported
--on Xen.
-+callgraph profiling. This option is available on x86 using a
-+2.6+ kernel with callgraph support enabled. It is also available on PowerPC using a 2.6.17+ kernel.
-+This option is not yet supported on Xen.
- .br
- .TP
- .BI "--image="[name,name...|"all"]
Index: oprofile.spec
===================================================================
RCS file: /cvs/pkgs/rpms/oprofile/F-7/oprofile.spec,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- oprofile.spec 23 Mar 2007 18:34:07 -0000 1.52
+++ oprofile.spec 13 Aug 2007 20:43:54 -0000 1.53
@@ -3,7 +3,7 @@
Summary: System wide profiler
Name: oprofile
Version: 0.9.2
-Release: 8%{?dist}
+Release: 9%{?dist}
License: GPL
Group: Development/System
#
@@ -66,7 +66,7 @@
%patch83 -p1 -b .xen
%patch87 -p1 -b .power6
#%patch88 -p0 -b .core
-%patch89 -p0 -b .ppc64doc
+%patch89 -p1 -b .ppc64doc
%patch90 -p0 -b .race
%patch91 -p1 -b .k10
@@ -272,6 +272,9 @@
%{_bindir}/oprof_start
%changelog
+* Wed Mar 21 2007 Will Cohen <wcohen at redhat.com> - 0.9.2-9
+- Tweak xen patch to support newer xenoprof.
+
* Wed Mar 21 2007 Will Cohen <wcohen at redhat.com> - 0.9.2-8
- Add AMD family 10 support. Resolves: rhbz#232956.
More information about the fedora-extras-commits
mailing list