You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nathan F. <nf...@au...> - 2009-09-02 21:24:33
|
When setting or retrieving system wide attributes such as the smt-snooze-delay or dscr we should only be concerned with online cpus/threads. Offline cpus/threads will not have these attributes in their sysfs directory. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2009-09-02 18:47:59.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2009-09-02 19:09:23.000000000 -0500 @@ -193,6 +193,19 @@ return 0; } +int cpu_online(int thread) +{ + char path[SYSFS_PATH_MAX]; + int rc, online; + + sprintf(path, SYSFS_CPUDIR"/online", thread); + rc = get_attribute(path, &online); + if (rc || !online) + return 0; + + return 1; +} + int get_system_attribute(char *attribute) { char path[SYSFS_PATH_MAX]; @@ -202,8 +215,11 @@ for (i = 0; i < MAX_THREADS; i++) { int cpu_attribute; - sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); + /* only check online cpus */ + if (!cpu_online(i)) + continue; + sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); rc = get_attribute(path, &cpu_attribute); if (rc) continue; @@ -223,6 +239,10 @@ int i, rc; for (i = 0; i < MAX_THREADS; i++) { + /* only set online cpus */ + if (!cpu_online(i)) + continue; + sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); rc = set_attribute(path, state); if (rc) |
From: Nathan F. <nf...@au...> - 2009-09-02 21:22:14
|
The ppc64_cpu command needs to properly turn off the smt snooze delay. The current code does not handle the option 'off', it should as this is regarded as a delay of -1. Signed-off-by:Nathan Fontenot <nf...@au...> -- Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2009-09-02 18:39:30.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2009-09-02 18:47:59.000000000 -0500 @@ -308,8 +308,16 @@ printf("Inconsistent smt_snooze_delay\n"); else printf("smt_snooze_delay is %d\n", ssd); - } else - rc = set_system_attribute("smt_snooze_delay", strtol(state, NULL, 0)); + } else { + int delay; + + if (!strcmp(state, "off")) + delay = -1; + else + delay = strtol(state, NULL, 0); + + rc = set_system_attribute("smt_snooze_delay", delay); + } return rc; } |
From: Nathan F. <nf...@au...> - 2009-09-02 20:59:10
|
Looks good to me, this would definitely help when drmgr hangs on something. I'm fine pulling in this patch unless there are objections. -Nathan Robert Jennings wrote: > DR commands shouldn't take long to complete, but having both an entry > and exit timestamp eliminates the guessing and can point people in the > correct direction while they debug issues. > > Signed-off-by: Robert Jennings <rc...@li...> > > --- > src/drmgr/common.c | 9 ++++++++- > src/drmgr/drmgr.c | 21 ++++++++++++++------- > 2 files changed, 22 insertions(+), 8 deletions(-) > > Index: b/src/drmgr/common.c > =================================================================== > --- a/src/drmgr/common.c > +++ b/src/drmgr/common.c > @@ -63,7 +63,7 @@ dr_init(void) > time_t t; > char tbuf[128]; > > - /* Insert seperator between drmgr invocations */ > + /* Insert seperator at beginning of drmgr invocation */ > time(&t); > strftime(tbuf, 128, "%b %d %T %G", localtime(&t)); > dbg("\n########## %s ##########\n", tbuf); > @@ -81,12 +81,19 @@ dr_fini(void) > struct stat sbuf; > int max_dr_log_sz = 25000; > int rc; > + time_t t; > + char tbuf[128]; > > free_drc_info(); > > if (! log_fd) > return; > > + /* Insert seperator at end of drmgr invocation */ > + time(&t); > + strftime(tbuf, 128, "%b %d %T %G", localtime(&t)); > + dbg("########## %s ##########\n", tbuf); > + > close(log_fd); > > /* Check for log rotation */ > Index: b/src/drmgr/drmgr.c > =================================================================== > --- a/src/drmgr/drmgr.c > +++ b/src/drmgr/drmgr.c > @@ -355,36 +355,42 @@ main(int argc, char *argv[]) > > if (display_capabilities) { > print_dlpar_capabilities(); > - return 0; > + rc = 0; > + goto exit; > } > > command = get_command(&opts); > > if (display_usage) { > command_usage(command); > - return 0; > + rc = 0; > + goto exit; > } > > /* Validate the options for the action we want to perform */ > rc = command->validate_options(&opts); > if (rc) > - return rc; > + goto exit; > > /* Validate this platform */ > - if (! valid_platform("chrp")) > - exit(1); > + if (! valid_platform("chrp")) { > + rc = 1; > + goto exit; > + } > > /* Mask signals so we do not get interrupted */ > if (sig_setup()) { > err_msg("Could not mask signals to avoid interrupts\n"); > - return -1; > + rc = -1; > + goto exit; > } > > rc = dr_lock(opts.timeout); > if (rc) { > err_msg("Unable to obtain Dynamic Reconfiguration lock. " > "Please try command again later.\n"); > - return -1; > + rc = -1; > + goto exit; > } > > /* Log this invocation to /var/log/messages and /var/log/drmgr */ > @@ -400,6 +406,7 @@ main(int argc, char *argv[]) > rc = command->func(&opts); > > dr_unlock(); > +exit: > dr_fini(); > return rc; > } |
From: Robert J. <rc...@li...> - 2009-09-02 16:10:11
|
DR commands shouldn't take long to complete, but having both an entry and exit timestamp eliminates the guessing and can point people in the correct direction while they debug issues. Signed-off-by: Robert Jennings <rc...@li...> --- src/drmgr/common.c | 9 ++++++++- src/drmgr/drmgr.c | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) Index: b/src/drmgr/common.c =================================================================== --- a/src/drmgr/common.c +++ b/src/drmgr/common.c @@ -63,7 +63,7 @@ dr_init(void) time_t t; char tbuf[128]; - /* Insert seperator between drmgr invocations */ + /* Insert seperator at beginning of drmgr invocation */ time(&t); strftime(tbuf, 128, "%b %d %T %G", localtime(&t)); dbg("\n########## %s ##########\n", tbuf); @@ -81,12 +81,19 @@ dr_fini(void) struct stat sbuf; int max_dr_log_sz = 25000; int rc; + time_t t; + char tbuf[128]; free_drc_info(); if (! log_fd) return; + /* Insert seperator at end of drmgr invocation */ + time(&t); + strftime(tbuf, 128, "%b %d %T %G", localtime(&t)); + dbg("########## %s ##########\n", tbuf); + close(log_fd); /* Check for log rotation */ Index: b/src/drmgr/drmgr.c =================================================================== --- a/src/drmgr/drmgr.c +++ b/src/drmgr/drmgr.c @@ -355,36 +355,42 @@ main(int argc, char *argv[]) if (display_capabilities) { print_dlpar_capabilities(); - return 0; + rc = 0; + goto exit; } command = get_command(&opts); if (display_usage) { command_usage(command); - return 0; + rc = 0; + goto exit; } /* Validate the options for the action we want to perform */ rc = command->validate_options(&opts); if (rc) - return rc; + goto exit; /* Validate this platform */ - if (! valid_platform("chrp")) - exit(1); + if (! valid_platform("chrp")) { + rc = 1; + goto exit; + } /* Mask signals so we do not get interrupted */ if (sig_setup()) { err_msg("Could not mask signals to avoid interrupts\n"); - return -1; + rc = -1; + goto exit; } rc = dr_lock(opts.timeout); if (rc) { err_msg("Unable to obtain Dynamic Reconfiguration lock. " "Please try command again later.\n"); - return -1; + rc = -1; + goto exit; } /* Log this invocation to /var/log/messages and /var/log/drmgr */ @@ -400,6 +406,7 @@ main(int argc, char *argv[]) rc = command->func(&opts); dr_unlock(); +exit: dr_fini(); return rc; } |
From: Nathan F. <nf...@au...> - 2009-08-25 16:56:16
|
Applied. -Nathan Robert Jennings wrote: > Currently, print_node_list will never print the children of a node. > Just correcting a small bit of the logic. > > Signed-off-by: Robert Jennings <rc...@li...> > > --- > src/drmgr/common_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: b/src/drmgr/common_pci.c > =================================================================== > --- a/src/drmgr/common_pci.c > +++ b/src/drmgr/common_pci.c > @@ -1171,7 +1171,7 @@ print_node_list(struct dr_node *first_no > parent->drc_name, parent->loc_code); > > child = parent->children; > - while (child && child != parent->children) { > + while (child) { > dbg("%s: %s\n" > "\tdrc index: 0x%x description: %s\n" > "\tdrc name: %s\n\tloc code: %s\n", > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2009-08-25 16:56:10
|
Applied. -Nathan Robert Jennings wrote: > Add HEA ports as a new connector type to lsslot. Ports will be sorted on > location code, not name, so the output might look as follows (debug output > included). > > # ./lsslot -d 4 -c port > Getting node types 0x00000004 > > DR nodes list > ============== > /proc/device-tree/lhea@23c00400: > drc index: 0x23c00400 description: HEA I/O Slot > drc name: HEA 1 > loc code: U789D.001.DQDYGLC-P1 > /proc/device-tree/lhea@23c00400/ethernet@23e00300: > drc index: 0x23e00300 description: HEA Port I/O Slot > drc name: Port 4 > loc code: U789D.001.DQDYGLC-P1-C10-T1 > /proc/device-tree/lhea@23c00400/ethernet@23e00000: > drc index: 0x23e00000 description: HEA Port I/O Slot > drc name: Port 1 > loc code: U789D.001.DQDYGLC-P1-C10-T2 > > LHEA port name Description > Port 4 HEA Port I/O Slot > Port 1 HEA Port I/O Slot > > Signed-off-by: Robert Jennings <rc...@li...> > > --- > I am correcting an error in the format for printing with delimiters. > > --- > src/drmgr/lsslot.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > src/drmgr/lsslot.h | 1 + > 2 files changed, 97 insertions(+) > > Index: b/src/drmgr/lsslot.c > =================================================================== > --- a/src/drmgr/lsslot.c > +++ b/src/drmgr/lsslot.c > @@ -410,6 +410,8 @@ parse_options(int argc, char *argv[], st > opts->slot_type = CPU; > else if (! strcmp(optarg, "mem")) > opts->slot_type = MEM; > + else if (! strcmp(optarg, "port")) > + opts->slot_type = PORT; > else { > printf("\nThe specified connector type " > "is invalid.\n\n"); > @@ -463,6 +465,7 @@ parse_options(int argc, char *argv[], st > /* Validate the options */ > switch (opts->slot_type) { > case SLOT: > + case PORT: > /* The a,b,o,p flags are not valid for slot */ > if (opts->a_flag || opts->b_flag || opts->o_flag || > opts->p_flag) > @@ -748,6 +751,95 @@ lsslot_chrp_mem(void) > return 0; > } > > +/** > + * lsslot_chrp_port > + * @brief Print LHEA ports based on command line options > + * > + * @param opts > + * @returns 0 on success, !0 otherwise > + */ > +int > +lsslot_chrp_port(struct cmd_opts *opts) > +{ > + struct dr_node *all_nodes; /* Pointer to list of all node info */ > + struct dr_node *node; /* Used to traverse list of node info */ > + struct dr_node *child; /* Used to traverse list of children */ > + char fmt[128]; > + struct print_node *p; > + char *sheading = "LHEA port name"; /* Used in printing headers */ > + char *dheading = "Description"; /* Used in printing headers */ > + int rc = 0; > + > + /* Set initial column sizes */ > + max_sname = MAX(max_sname, strlen(sheading)); > + max_desc = MAX(max_desc, strlen(dheading)); > + > + all_nodes = get_dlpar_nodes(HEA_NODES); > + > + /* If nothing returned, then no hot plug node */ > + if (all_nodes == NULL) { > + err_msg("There are no LHEA ports on this system.\n"); > + return 1; > + } > + > + print_node_list(all_nodes); > + > + /* Otherwise, run through the node list looking for the nodes > + * we want to print > + */ > + for (node = all_nodes; node; node = node->next) { > + if (node->skip) > + continue; > + > + for (child = node->children; child; child = child->next) { > + if (child->skip) > + continue; > + /* If there is a search parameter, add matching ports. > + * If there is no search, add all the ports. > + */ > + if (opts->s_name != NULL) { > + if (cmp_drcname(child->drc_name, opts->s_name)) > + insert_print_node(child); > + } else > + insert_print_node(child); > + } > + } > + > + if (print_list == NULL) { > + /* If nothing to print, display message based on if > + * user specified a slot or a device name. > + */ > + if (opts->s_name != NULL) { > + err_msg("The specified port was not found.\n"); > + rc = 1; > + } > + goto lsslot_port_exit; > + } > + > + /* This creates a format string so that port name and description > + * prints out in the required field width. When the -F flag is > + * specified, the format string contains the delimiting character > + * which the user specified at the command line. > + */ > + if (opts->delim != NULL) > + sprintf(fmt, "%s%s%s\n", "%s", opts->delim, "%s"); > + else { > + sprintf(fmt, "%%-%ds%%-%ds\n", max_sname + 2, max_desc + 2); > + /* Print out the header. */ > + printf(fmt, sheading, dheading); > + } > + > + /* Now run through the list of ports we actually want to print */ > + for (p = print_list; p != NULL; p = p->next) { > + printf(fmt, p->node->drc_name, p->desc); > + } > + > +lsslot_port_exit: > + free_print_list(); > + free_node(all_nodes); > + return rc; > +} > + > int > main(int argc, char *argv[]) > { > @@ -788,6 +880,10 @@ main(int argc, char *argv[]) > case MEM: > rc = lsslot_chrp_mem(); > break; > + > + case PORT: > + rc = lsslot_chrp_port(&opts); > + break; > } > > dr_unlock(); > Index: b/src/drmgr/lsslot.h > =================================================================== > --- a/src/drmgr/lsslot.h > +++ b/src/drmgr/lsslot.h > @@ -18,6 +18,7 @@ struct cmd_opts { > #define PHB 2 > #define CPU 3 > #define MEM 4 > +#define PORT 5 > > int a_flag; > int o_flag; > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Robert J. <rc...@li...> - 2009-08-18 14:11:46
|
Add HEA ports as a new connector type to lsslot. Ports will be sorted on location code, not name, so the output might look as follows (debug output included). # ./lsslot -d 4 -c port Getting node types 0x00000004 DR nodes list ============== /proc/device-tree/lhea@23c00400: drc index: 0x23c00400 description: HEA I/O Slot drc name: HEA 1 loc code: U789D.001.DQDYGLC-P1 /proc/device-tree/lhea@23c00400/ethernet@23e00300: drc index: 0x23e00300 description: HEA Port I/O Slot drc name: Port 4 loc code: U789D.001.DQDYGLC-P1-C10-T1 /proc/device-tree/lhea@23c00400/ethernet@23e00000: drc index: 0x23e00000 description: HEA Port I/O Slot drc name: Port 1 loc code: U789D.001.DQDYGLC-P1-C10-T2 LHEA port name Description Port 4 HEA Port I/O Slot Port 1 HEA Port I/O Slot Signed-off-by: Robert Jennings <rc...@li...> --- I am correcting an error in the format for printing with delimiters. --- src/drmgr/lsslot.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/drmgr/lsslot.h | 1 + 2 files changed, 97 insertions(+) Index: b/src/drmgr/lsslot.c =================================================================== --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -410,6 +410,8 @@ parse_options(int argc, char *argv[], st opts->slot_type = CPU; else if (! strcmp(optarg, "mem")) opts->slot_type = MEM; + else if (! strcmp(optarg, "port")) + opts->slot_type = PORT; else { printf("\nThe specified connector type " "is invalid.\n\n"); @@ -463,6 +465,7 @@ parse_options(int argc, char *argv[], st /* Validate the options */ switch (opts->slot_type) { case SLOT: + case PORT: /* The a,b,o,p flags are not valid for slot */ if (opts->a_flag || opts->b_flag || opts->o_flag || opts->p_flag) @@ -748,6 +751,95 @@ lsslot_chrp_mem(void) return 0; } +/** + * lsslot_chrp_port + * @brief Print LHEA ports based on command line options + * + * @param opts + * @returns 0 on success, !0 otherwise + */ +int +lsslot_chrp_port(struct cmd_opts *opts) +{ + struct dr_node *all_nodes; /* Pointer to list of all node info */ + struct dr_node *node; /* Used to traverse list of node info */ + struct dr_node *child; /* Used to traverse list of children */ + char fmt[128]; + struct print_node *p; + char *sheading = "LHEA port name"; /* Used in printing headers */ + char *dheading = "Description"; /* Used in printing headers */ + int rc = 0; + + /* Set initial column sizes */ + max_sname = MAX(max_sname, strlen(sheading)); + max_desc = MAX(max_desc, strlen(dheading)); + + all_nodes = get_dlpar_nodes(HEA_NODES); + + /* If nothing returned, then no hot plug node */ + if (all_nodes == NULL) { + err_msg("There are no LHEA ports on this system.\n"); + return 1; + } + + print_node_list(all_nodes); + + /* Otherwise, run through the node list looking for the nodes + * we want to print + */ + for (node = all_nodes; node; node = node->next) { + if (node->skip) + continue; + + for (child = node->children; child; child = child->next) { + if (child->skip) + continue; + /* If there is a search parameter, add matching ports. + * If there is no search, add all the ports. + */ + if (opts->s_name != NULL) { + if (cmp_drcname(child->drc_name, opts->s_name)) + insert_print_node(child); + } else + insert_print_node(child); + } + } + + if (print_list == NULL) { + /* If nothing to print, display message based on if + * user specified a slot or a device name. + */ + if (opts->s_name != NULL) { + err_msg("The specified port was not found.\n"); + rc = 1; + } + goto lsslot_port_exit; + } + + /* This creates a format string so that port name and description + * prints out in the required field width. When the -F flag is + * specified, the format string contains the delimiting character + * which the user specified at the command line. + */ + if (opts->delim != NULL) + sprintf(fmt, "%s%s%s\n", "%s", opts->delim, "%s"); + else { + sprintf(fmt, "%%-%ds%%-%ds\n", max_sname + 2, max_desc + 2); + /* Print out the header. */ + printf(fmt, sheading, dheading); + } + + /* Now run through the list of ports we actually want to print */ + for (p = print_list; p != NULL; p = p->next) { + printf(fmt, p->node->drc_name, p->desc); + } + +lsslot_port_exit: + free_print_list(); + free_node(all_nodes); + return rc; +} + int main(int argc, char *argv[]) { @@ -788,6 +880,10 @@ main(int argc, char *argv[]) case MEM: rc = lsslot_chrp_mem(); break; + + case PORT: + rc = lsslot_chrp_port(&opts); + break; } dr_unlock(); Index: b/src/drmgr/lsslot.h =================================================================== --- a/src/drmgr/lsslot.h +++ b/src/drmgr/lsslot.h @@ -18,6 +18,7 @@ struct cmd_opts { #define PHB 2 #define CPU 3 #define MEM 4 +#define PORT 5 int a_flag; int o_flag; |
From: Robert J. <rc...@li...> - 2009-08-18 14:10:52
|
Currently, print_node_list will never print the children of a node. Just correcting a small bit of the logic. Signed-off-by: Robert Jennings <rc...@li...> --- src/drmgr/common_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: b/src/drmgr/common_pci.c =================================================================== --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -1171,7 +1171,7 @@ print_node_list(struct dr_node *first_no parent->drc_name, parent->loc_code); child = parent->children; - while (child && child != parent->children) { + while (child) { dbg("%s: %s\n" "\tdrc index: 0x%x description: %s\n" "\tdrc name: %s\n\tloc code: %s\n", |
From: Robert J. <rc...@li...> - 2009-08-04 20:36:32
|
Add HEA ports as a new connector type to lsslot. Ports will be sorted on location code, not name, so the output might look as follows (debug output included). # ./lsslot -d 4 -c port Getting node types 0x00000004 DR nodes list ============== /proc/device-tree/lhea@23c00400: drc index: 0x23c00400 description: HEA I/O Slot drc name: HEA 1 loc code: U789D.001.DQDYGLC-P1 /proc/device-tree/lhea@23c00400/ethernet@23e00300: drc index: 0x23e00300 description: HEA Port I/O Slot drc name: Port 4 loc code: U789D.001.DQDYGLC-P1-C10-T1 /proc/device-tree/lhea@23c00400/ethernet@23e00000: drc index: 0x23e00000 description: HEA Port I/O Slot drc name: Port 1 loc code: U789D.001.DQDYGLC-P1-C10-T2 LHEA port name Description Port 4 HEA Port I/O Slot Port 1 HEA Port I/O Slot Signed-off-by: Robert Jennings <rc...@li...> --- I am correcting an error in the format for printing with delimiters. --- src/drmgr/lsslot.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/drmgr/lsslot.h | 1 + 2 files changed, 97 insertions(+) Index: b/src/drmgr/lsslot.c =================================================================== --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -410,6 +410,8 @@ parse_options(int argc, char *argv[], st opts->slot_type = CPU; else if (! strcmp(optarg, "mem")) opts->slot_type = MEM; + else if (! strcmp(optarg, "port")) + opts->slot_type = PORT; else { printf("\nThe specified connector type " "is invalid.\n\n"); @@ -463,6 +465,7 @@ parse_options(int argc, char *argv[], st /* Validate the options */ switch (opts->slot_type) { case SLOT: + case PORT: /* The a,b,o,p flags are not valid for slot */ if (opts->a_flag || opts->b_flag || opts->o_flag || opts->p_flag) @@ -748,6 +751,95 @@ lsslot_chrp_mem(void) return 0; } +/** + * lsslot_chrp_port + * @brief Print LHEA ports based on command line options + * + * @param opts + * @returns 0 on success, !0 otherwise + */ +int +lsslot_chrp_port(struct cmd_opts *opts) +{ + struct dr_node *all_nodes; /* Pointer to list of all node info */ + struct dr_node *node; /* Used to traverse list of node info */ + struct dr_node *child; /* Used to traverse list of children */ + char fmt[128]; + struct print_node *p; + char *sheading = "LHEA port name"; /* Used in printing headers */ + char *dheading = "Description"; /* Used in printing headers */ + int rc = 0; + + /* Set initial column sizes */ + max_sname = MAX(max_sname, strlen(sheading)); + max_desc = MAX(max_desc, strlen(dheading)); + + all_nodes = get_dlpar_nodes(HEA_NODES); + + /* If nothing returned, then no hot plug node */ + if (all_nodes == NULL) { + err_msg("There are no LHEA ports on this system.\n"); + return 1; + } + + print_node_list(all_nodes); + + /* Otherwise, run through the node list looking for the nodes + * we want to print + */ + for (node = all_nodes; node; node = node->next) { + if (node->skip) + continue; + + for (child = node->children; child; child = child->next) { + if (child->skip) + continue; + /* If there is a search parameter, add matching ports. + * If there is no search, add all the ports. + */ + if (opts->s_name != NULL) { + if (cmp_drcname(child->drc_name, opts->s_name)) + insert_print_node(child); + } else + insert_print_node(child); + } + } + + if (print_list == NULL) { + /* If nothing to print, display message based on if + * user specified a slot or a device name. + */ + if (opts->s_name != NULL) { + err_msg("The specified port was not found.\n"); + rc = 1; + } + goto lsslot_port_exit; + } + + /* This creates a format string so that port name and description + * prints out in the required field width. When the -F flag is + * specified, the format string contains the delimiting character + * which the user specified at the command line. + */ + if (opts->delim != NULL) + sprintf(fmt, "%s%s%s\n", "%s", opts->delim, "%s"); + else { + sprintf(fmt, "%%-%ds%%-%ds\n", max_sname + 2, max_desc + 2); + /* Print out the header. */ + printf(fmt, sheading, dheading); + } + + /* Now run through the list of ports we actually want to print */ + for (p = print_list; p != NULL; p = p->next) { + printf(fmt, p->node->drc_name, p->desc); + } + +lsslot_port_exit: + free_print_list(); + free_node(all_nodes); + return rc; +} + int main(int argc, char *argv[]) { @@ -788,6 +880,10 @@ main(int argc, char *argv[]) case MEM: rc = lsslot_chrp_mem(); break; + + case PORT: + rc = lsslot_chrp_port(&opts); + break; } dr_unlock(); Index: b/src/drmgr/lsslot.h =================================================================== --- a/src/drmgr/lsslot.h +++ b/src/drmgr/lsslot.h @@ -18,6 +18,7 @@ struct cmd_opts { #define PHB 2 #define CPU 3 #define MEM 4 +#define PORT 5 int a_flag; int o_flag; |
From: Robert J. <rc...@li...> - 2009-08-04 20:30:10
|
Add HEA ports as a new connector type to lsslot (-c port). Ports will be sorted on location code, not name, so the output might look as follows (debug output included). # ./lsslot -d 4 -c port Getting node types 0x00000004 DR nodes list ============== /proc/device-tree/lhea@23c00400: drc index: 0x23c00400 description: HEA I/O Slot drc name: HEA 1 loc code: U789D.001.DQDYGLC-P1 /proc/device-tree/lhea@23c00400/ethernet@23e00300: drc index: 0x23e00300 description: HEA Port I/O Slot drc name: Port 4 loc code: U789D.001.DQDYGLC-P1-C10-T1 /proc/device-tree/lhea@23c00400/ethernet@23e00000: drc index: 0x23e00000 description: HEA Port I/O Slot drc name: Port 1 loc code: U789D.001.DQDYGLC-P1-C10-T2 LHEA port name Description Port 4 HEA Port I/O Slot Port 1 HEA Port I/O Slot Signed-off-by: Robert Jennings <rc...@li...> --- src/drmgr/lsslot.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/drmgr/lsslot.h | 1 + 2 files changed, 97 insertions(+) Index: b/src/drmgr/lsslot.c =================================================================== --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -410,6 +410,8 @@ parse_options(int argc, char *argv[], st opts->slot_type = CPU; else if (! strcmp(optarg, "mem")) opts->slot_type = MEM; + else if (! strcmp(optarg, "port")) + opts->slot_type = PORT; else { printf("\nThe specified connector type " "is invalid.\n\n"); @@ -463,6 +465,7 @@ parse_options(int argc, char *argv[], st /* Validate the options */ switch (opts->slot_type) { case SLOT: + case PORT: /* The a,b,o,p flags are not valid for slot */ if (opts->a_flag || opts->b_flag || opts->o_flag || opts->p_flag) @@ -748,6 +751,95 @@ lsslot_chrp_mem(void) return 0; } +/** + * lsslot_chrp_port + * @brief Print LHEA ports based on command line options + * + * @param opts + * @returns 0 on success, !0 otherwise + */ +int +lsslot_chrp_port(struct cmd_opts *opts) +{ + struct dr_node *all_nodes; /* Pointer to list of all node info */ + struct dr_node *node; /* Used to traverse list of node info */ + struct dr_node *child; /* Used to traverse list of children */ + char fmt[128]; + struct print_node *p; + char *sheading = "LHEA port name"; /* Used in printing headers */ + char *dheading = "Description"; /* Used in printing headers */ + int rc = 0; + + /* Set initial column sizes */ + max_sname = MAX(max_sname, strlen(sheading)); + max_desc = MAX(max_desc, strlen(dheading)); + + all_nodes = get_dlpar_nodes(HEA_NODES); + + /* If nothing returned, then no hot plug node */ + if (all_nodes == NULL) { + err_msg("There are no LHEA ports on this system.\n"); + return 1; + } + + print_node_list(all_nodes); + + /* Otherwise, run through the node list looking for the nodes + * we want to print + */ + for (node = all_nodes; node; node = node->next) { + if (node->skip) + continue; + + for (child = node->children; child; child = child->next) { + if (child->skip) + continue; + /* If there is a search parameter, add matching ports. + * If there is no search, add all the ports. + */ + if (opts->s_name != NULL) { + if (cmp_drcname(child->drc_name, opts->s_name)) + insert_print_node(child); + } else + insert_print_node(child); + } + } + + if (print_list == NULL) { + /* If nothing to print, display message based on if + * user specified a slot or a device name. + */ + if (opts->s_name != NULL) { + err_msg("The specified port was not found.\n"); + rc = 1; + } + goto lsslot_port_exit; + } + + /* This creates a format string so that port name and description + * prints out in the required field width. When the -F flag is + * specified, the format string contains the delimiting character + * which the user specified at the command line. + */ + if (opts->delim != NULL) + sprintf(fmt, "%s%s%s", "%s\n", opts->delim, "%s"); + else { + sprintf(fmt, "%%-%ds%%-%ds\n", max_sname + 2, max_desc + 2); + /* Print out the header. */ + printf(fmt, sheading, dheading); + } + + /* Now run through the list of ports we actually want to print */ + for (p = print_list; p != NULL; p = p->next) { + printf(fmt, p->node->drc_name, p->desc); + } + +lsslot_port_exit: + free_print_list(); + free_node(all_nodes); + return rc; +} + int main(int argc, char *argv[]) { @@ -788,6 +880,10 @@ main(int argc, char *argv[]) case MEM: rc = lsslot_chrp_mem(); break; + + case PORT: + rc = lsslot_chrp_port(&opts); + break; } dr_unlock(); Index: b/src/drmgr/lsslot.h =================================================================== --- a/src/drmgr/lsslot.h +++ b/src/drmgr/lsslot.h @@ -18,6 +18,7 @@ struct cmd_opts { #define PHB 2 #define CPU 3 #define MEM 4 +#define PORT 5 int a_flag; int o_flag; |
From: Robert J. <rc...@li...> - 2009-08-04 20:28:38
|
Currently, print_node_list will never print the children of a node. Just correcting a small bit of the logic. Signed-off-by: Robert Jennings <rc...@li...> --- src/drmgr/common_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: b/src/drmgr/common_pci.c =================================================================== --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -1171,7 +1171,7 @@ print_node_list(struct dr_node *first_no parent->drc_name, parent->loc_code); child = parent->children; - while (child && child != parent->children) { + while (child) { dbg("%s: %s\n" "\tdrc index: 0x%x description: %s\n" "\tdrc name: %s\n\tloc code: %s\n", |
From: Robert J. <rc...@li...> - 2009-08-03 16:13:24
|
The logic in get_node_by_name() currently does not return when it finds a child with the name being search for. This would mean that a command such as `drmgr -Q -c port -s "Port 1" -w 0 -d 3` would always return: drmgr: Port 1 not owned by partition Signed-off-by: Robert Jennings <rc...@li...> --- src/drmgr/common_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: b/src/drmgr/common_pci.c =================================================================== --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -903,6 +903,7 @@ get_node_by_name(const char *drc_name, u { struct dr_node *node, *all_nodes; struct dr_node *prev_node = NULL; + int child_found = 0; all_nodes = get_dlpar_nodes(node_type); if (all_nodes == NULL) { @@ -920,9 +921,12 @@ get_node_by_name(const char *drc_name, u for (child = node->children; child; child = child->next) { if (strcmp(drc_name, child->drc_name) == 0) - break; + child_found = 1; } + if (child_found) + break; + prev_node = node; } |
From: Nathan F. <nf...@au...> - 2009-07-31 14:27:15
|
I have posted a tarball of the powerpc-utils-1.2.0 release on the sourceforge and ozlabs site. This is the first release of the combined powerpc-utils package and replaces previous releases of the powerpc-utils and powerpc-utils-papr packages (versions 1.1.X and before). -Nathan |
From: Brian K. <br...@li...> - 2009-07-30 19:39:49
|
The OpenFirmware binding for Fibre Channel devices permits any leading zeros in the LUN field to be stripped, but does not require it. Fix ofpathname to handle this case when translating OF pathname to logical device name. Signed-off-by: Brian King <br...@li...> --- scripts/ofpathname | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff -puN scripts/ofpathname~ofpathname_fc_strip_fix scripts/ofpathname --- powerpc-utils/scripts/ofpathname~ofpathname_fc_strip_fix 2009-07-30 13:41:44.000000000 -0500 +++ powerpc-utils-bjking1/scripts/ofpathname 2009-07-30 14:37:18.000000000 -0500 @@ -921,10 +921,14 @@ of2l_fc() local fc_lun=`get_fc_scsilun $LUN` local wwpn=`get_fc_wwpn "$device_path/fc_remote_ports*"` + let stripped_lun=`echo "10#$fc_lun"` + let stripped_oflun=`echo "10#$OF_LUN"` - if [[ $fc_lun = $OF_LUN && $wwpn = $OF_WWPN ]]; then - LOGICAL_DEVNAME="${dir##*/}" - return + if [[ $wwpn = $OF_WWPN ]]; then + if [[ $fc_lun = $OF_LUN || $stripped_lun = $stripped_oflun ]]; then + LOGICAL_DEVNAME="${dir##*/}" + return + fi fi done } _ |
From: Brian K. <br...@li...> - 2009-07-30 18:55:46
|
The OpenFirmware binding for Fibre Channel devices permits any leading zeros in the LUN field to be stripped, but does not require it. Fix ofpathname to handle this case when translating OF pathname to logical device name. Signed-off-by: Brian King <br...@li...> --- scripts/ofpathname | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN scripts/ofpathname~ofpathname_fc_strip_fix scripts/ofpathname --- powerpc-utils/scripts/ofpathname~ofpathname_fc_strip_fix 2009-07-30 13:41:44.000000000 -0500 +++ powerpc-utils-bjking1/scripts/ofpathname 2009-07-30 13:43:23.000000000 -0500 @@ -921,8 +921,9 @@ of2l_fc() local fc_lun=`get_fc_scsilun $LUN` local wwpn=`get_fc_wwpn "$device_path/fc_remote_ports*"` + let stripped_lun=`echo "10#$fc_lun"` - if [[ $fc_lun = $OF_LUN && $wwpn = $OF_WWPN ]]; then + if [[ ($fc_lun = $OF_LUN || $stripped_lun = $OF_LUN) && $wwpn = $OF_WWPN ]]; then LOGICAL_DEVNAME="${dir##*/}" return fi _ |
From: Nathan F. <nf...@au...> - 2009-07-23 19:10:54
|
This patch contains all of the additional updates needed to support the new version of ppc64_cpu, removal of old script and Makefile updates. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/scripts/ppc64_cpu =================================================================== --- powerpc-utils.orig/scripts/ppc64_cpu 2009-07-10 14:46:25.000000000 -0500 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,347 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (C) 2007 Anton Blanchard <an...@au...> IBM Corporation -# Common Public License Version 1.0 (see COPYRIGHT) -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -use strict; -use Getopt::Long; - -my $max_cpu = 1024; -my $cpudir = "/sys/devices/system/cpu/cpu%d"; - -sub is_smt_capable -{ - for (my $i = 0; $i < $max_cpu; $i++) { - my $snooze_file = sprintf("$cpudir/smt_snooze_delay", $i); - if (-f "$snooze_file") { - return 1; - } - } - - return 0; -} - -sub get_one_smt_state -{ - my ($primary_thread) = @_; - - my $online_file = sprintf("$cpudir/online", $primary_thread); - if (!(-f $online_file)) { - return -1; - } - - my $primary_online = `cat $online_file`; - chomp($primary_online); - - $online_file = sprintf("$cpudir/online", $primary_thread + 1); - if (!(-f $online_file)) { - return -1; - } - my $secondary_online = `cat $online_file`; - chomp($secondary_online); - - if ($primary_online == 0 && $secondary_online == 1) { - printf("Inconsistent state: primary thread %d offline but secondary thread %d online\n", $primary_thread, $primary_thread + 1); - } - - if ($primary_online == 0) { - return -1; - } - - if ($secondary_online == 1) { - return 1; - } else { - return 0; - } -} - -sub get_smt_state -{ - my $state = -1; - - for (my $i = 0; $i < $max_cpu; $i += 2) { - my $s = get_one_smt_state($i); - if ($s == -1) { - next; - } - - if ($state == -1) { - $state = $s; - } elsif ($s != $state) { - printf("Inconsistent state: mix of ST and SMT cores\n"); - exit(1); - } - } - - return $state; -} - -sub set_one_smt_state -{ - my ($primary_thread, $state) = @_; - - my $online_file = sprintf("$cpudir/online", $primary_thread); - if (!(-f $online_file)) { - return -1; - } - - open(ONLINE_FILE, "> $online_file") || - die("Could not open $online_file\n"); - printf(ONLINE_FILE "1\n"); - close(ONLINE_FILE); - - $online_file = sprintf("$cpudir/online", $primary_thread + 1); - if (!(-f $online_file)) { - return -1; - } - - open(ONLINE_FILE, "> $online_file") || - die("Could not open $online_file\n"); - printf(ONLINE_FILE "%d\n", $state); - close(ONLINE_FILE); -} - -sub set_smt_state -{ - my ($state) = @_; - - for (my $i = 0; $i < $max_cpu; $i += 2) { - set_one_smt_state($i, $state); - } -} - -sub is_dscr_capable -{ - for (my $i = 0; $i < $max_cpu; $i++) { - my $dscr_file = sprintf("$cpudir/dscr", $i); - if (-f "$dscr_file") { - return 1; - } - } - - return 0; -} - -sub set_one_smt_snooze_delay -{ - my ($thread, $val) = @_; - - my $file = sprintf("$cpudir/smt_snooze_delay", $thread); - if (!(-f $file)) { - return -1; - } - - open(FILE, "> $file") || die("Could not open $file\n"); - printf(FILE "%d\n", $val); - close(FILE); -} - -sub set_smt_snooze_delay -{ - my ($val) = @_; - - for (my $i = 0; $i < $max_cpu; $i++) { - set_one_smt_snooze_delay($i, $val); - } -} - -sub get_one_smt_snooze_delay -{ - my ($thread) = @_; - - my $file = sprintf("$cpudir/smt_snooze_delay", $thread); - if (!(-f $file)) { - return -1; - } - - my $snooze = `cat $file`; - chomp($snooze); - - return $snooze; -} - -sub get_smt_snooze_delay -{ - my $val = -1; - - for (my $i = 0; $i < $max_cpu; $i++) { - my $v = get_one_smt_snooze_delay($i); - if ($v == -1) { - next; - } - - if ($val == -1) { - $val = $v; - } elsif ($val != $v) { - printf("Inconsistent smt_snooze_val\n"); - exit(1); - } - } - - return $val; -} - -sub get_one_dscr -{ - my ($thread) = @_; - - my $file = sprintf("$cpudir/dscr", $thread); - if (!(-f $file)) { - return -1; - } - - my $dscr = `cat $file`; - chomp($dscr); - - return hex($dscr); -} - -sub get_dscr -{ - my $val = -1; - - for (my $i = 0; $i < $max_cpu; $i++) { - my $v = get_one_dscr($i); - if ($v == -1) { - next; - } - - if ($val == -1) { - $val = $v; - } elsif ($val != $v) { - printf("Inconsistent DSCR\n"); - exit(1); - } - } - - return $val; -} - -sub set_one_dscr -{ - my ($thread, $val) = @_; - - my $file = sprintf("$cpudir/dscr", $thread); - if (!(-f $file)) { - return -1; - } - - open(FILE, "> $file") || die("Could not open $file\n"); - printf(FILE "0x%x\n", $val); - close(FILE); -} - -sub set_dscr -{ - my ($val) = @_; - - for (my $i = 0; $i < $max_cpu; $i++) { - set_one_dscr($i, $val); - } -} - -sub usage -{ - print <<EOF; -Usage: - ppc64_cpu --smt # Get current SMT state - ppc64_cpu --smt={on|off} # Set SMT state - - ppc64_cpu --dscr # Get current DSCR setting - ppc64_cpu --dscr=<val> # Change DSCR setting - - ppc64_cpu --smt-snooze-delay # Get current smt-snooze-delay setting - ppc64_cpu --smt-snooze-delay=<val> # Change smt-snooze-delay setting - -EOF -} - -sub do_smt -{ - my ($opt) = @_; - - if (!is_smt_capable()) { - printf("Machine is not SMT capable\n"); - exit(1); - } - - if ($opt eq "on") { - set_smt_state(1); - } elsif ($opt eq "off") { - set_smt_state(0); - } elsif ($opt eq "") { - my $smt = get_smt_state(); - if ($smt == 0) { - printf("smt is off\n"); - } elsif ($smt == 1) { - printf("smt is on\n"); - } else { - printf("Inconsistent state\n"); - } - } else { - print "blah $opt\n"; - usage(); - } -} - -sub do_dscr -{ - my ($opt) = @_; - - if (!is_dscr_capable()) { - printf("Machine is not DSCR capable\n"); - exit(1); - } - - if ($opt eq "") { - my $s = get_dscr(); - printf("dscr is %d\n", $s); - } elsif ($opt =~ /[0-9]+/) { - set_dscr($opt); - } else { - usage(); - } -} - -sub do_smt_snooze_delay -{ - my ($opt) = @_; - - if (!is_smt_capable()) { - printf("Machine is not SMT capable\n"); - exit(1); - } - - if ($opt eq "") { - my $s = get_smt_snooze_delay(); - printf("smt_snooze_delay is %d\n", $s); - } elsif ($opt =~ /[0-9]+/) { - set_smt_snooze_delay($opt); - } else { - usage(); - } -} - - -my $smt; -my $dscr; -my $smt_snooze_delay; -GetOptions( - "smt:s" => \$smt, - "dscr:s" => \$dscr, - "smt-snooze-delay:s" => \$smt_snooze_delay, -); - -if (defined($smt)) { - do_smt($smt) -} elsif (defined($dscr)) { - do_dscr($dscr) -} elsif (defined($smt_snooze_delay)) { - do_smt_snooze_delay($smt_snooze_delay) -} else { - usage(); -} Index: powerpc-utils/scripts/Makefile.am =================================================================== --- powerpc-utils.orig/scripts/Makefile.am 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/scripts/Makefile.am 2009-07-23 18:14:31.000000000 -0500 @@ -3,7 +3,7 @@ bin_SCRIPTS = amsstat sbin_SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump snap \ - bootlist ofpathname ppc64_cpu + bootlist ofpathname initdir = /etc/init.d init_DATA = ibmvscsis.sh Index: powerpc-utils/src/Makefile.am =================================================================== --- powerpc-utils.orig/src/Makefile.am 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/src/Makefile.am 2009-07-23 18:15:54.000000000 -0500 @@ -5,7 +5,7 @@ sbin_PROGRAMS = activate_firmware usysident usysattn set_poweron_time \ rtas_ibm_get_vpd serv_config uesensor rtas_event_decode sys_ident \ - nvram lsprop + nvram lsprop ppc64_cpu activate_firmware_SOURCES = activate_fw.c activate_firmware_LDFLAGS = -lrtas @@ -38,3 +38,6 @@ nvram_LDFLAGS = -ldl lsprop_SOURCES = lsprop.c + +ppc64_cpu_SOURCES = ppc64_cpu.c +ppc64_cpu_LDFLAGS = -lrtas |
From: Nathan F. <nf...@au...> - 2009-07-23 19:09:43
|
This is really more of a re-write than an update. The ppc64_cpu command is being ported from Perl to C to support new functionality. This update introduces two new pieces of functionality to the command. 1) Add the ability to set the SMT mode to a certain value in addition to turning it on and off. 2) Add the ability to set and display the cpu diagnostics run mode. This functionality required the port to C since this ability requires the use of librtas. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ powerpc-utils/src/ppc64_cpu.c 2009-07-23 18:10:11.000000000 -0500 @@ -0,0 +1,420 @@ +/** + * Copyright (C) 2007 Anton Blanchard <an...@au...> IBM Corporation + * Common Public License Version 1.0 (see COPYRIGHT) + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <dirent.h> +#include <librtas.h> +#include <sys/stat.h> +#define _GNU_SOURCE +#include <getopt.h> + +#define SYSFS_CPUDIR "/sys/devices/system/cpu/cpu%d" +#define SYSFS_PATH_MAX 128 +#define MAX_THREADS 1024 + +#define DIAGNOSTICS_RUN_MODE 42 + +int threads_per_cpu; + +int get_attribute(char *path, int *value) +{ + FILE *fp; + + fp = fopen(path, "r"); + if (fp == NULL) + return -1; + + fscanf(fp, "%i", value); + fclose(fp); + + return 0; +} + +int set_attribute(char *path, int value) +{ + FILE *fp; + + fp = fopen(path, "w"); + if (fp == NULL) + return -1; + + fprintf(fp, "%d", value); + fclose(fp); + + return 0; +} + +int get_threads_per_cpu(void) +{ + DIR *d; + struct dirent *de; + int nthreads; + int rc; + + d = opendir("/proc/device-tree/cpus"); + if (!d) + return -1; + + while ((de = readdir(d)) != NULL) { + if (!strncmp(de->d_name, "PowerPC", 7)) { + struct stat sbuf; + char path[128]; + + sprintf(path, "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s", + de->d_name); + rc = stat(path, &sbuf); + if (!rc) + nthreads = sbuf.st_size / 4; + + break; + } + } + + closedir(d); + return nthreads; +} + +int is_smt_capable(void) +{ + struct stat sb; + char path[SYSFS_PATH_MAX]; + int i; + + for (i = 0; i < MAX_THREADS; i++) { + sprintf(path, SYSFS_CPUDIR"/smt_snooze_delay", i); + if (stat(path, &sb)) + continue; + return 1; + } + + return 0; +} + +int get_one_smt_state(int primary_thread) +{ + struct stat sb; + char online_file[SYSFS_PATH_MAX]; + int thread_state; + int smt_state = 0; + int i, rc; + + for (i = 0; i < threads_per_cpu; i++) { + sprintf(online_file, SYSFS_CPUDIR"/%s", primary_thread + i, "online"); + if (stat(online_file, &sb)) + return -1; + + rc = get_attribute(online_file, &thread_state); + if (rc) + return -1; + + smt_state += thread_state; + } + + return smt_state ? smt_state : -1; +} + +int get_smt_state(void) +{ + int system_state = -1; + int i; + + for (i = 0; i < MAX_THREADS; i += threads_per_cpu) { + int cpu_state; + + cpu_state = get_one_smt_state(i); + if (cpu_state == -1) + continue; + + if (system_state == -1) + system_state = cpu_state; + else if (system_state != cpu_state) + return -1; + } + + return system_state; +} + +int set_one_smt_state(int thread, int online_threads) +{ + char path[SYSFS_PATH_MAX]; + int i, rc; + + for (i = 0; i < online_threads; i++) { + snprintf(path, SYSFS_PATH_MAX, SYSFS_CPUDIR"/%s", thread + i, "online"); + rc = set_attribute(path, 1); + if (rc) + return rc; + } + + for (; i < threads_per_cpu; i++) { + snprintf(path, SYSFS_PATH_MAX, SYSFS_CPUDIR"/%s", thread + i, "online"); + rc = set_attribute(path, 0); + if (rc) + break; + } + + return rc; +} + +int set_smt_state(int smt_state) +{ + int i, rc; + + for (i = 0; i < MAX_THREADS; i += threads_per_cpu) { + rc = set_one_smt_state(i, smt_state); + if (rc) + break; + } + + return rc; +} + +int is_dscr_capable(void) +{ + struct stat sb; + char path[SYSFS_PATH_MAX]; + int i; + + for (i = 0; i < MAX_THREADS; i++) { + sprintf(path, SYSFS_CPUDIR"/dscr", i); + if (stat(path, &sb)) + continue; + return 1; + } + + return 0; +} + +int get_system_attribute(char *attribute) +{ + char path[SYSFS_PATH_MAX]; + int i, rc; + int system_attribute = -1; + + for (i = 0; i < MAX_THREADS; i++) { + int cpu_attribute; + + sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); + + rc = get_attribute(path, &cpu_attribute); + if (rc) + continue; + + if (system_attribute == -1) + system_attribute = cpu_attribute; + else if (system_attribute != cpu_attribute) + return -1; + } + + return system_attribute; +} + +int set_system_attribute(char *attribute, int state) +{ + char path[SYSFS_PATH_MAX]; + int i, rc; + + for (i = 0; i < MAX_THREADS; i++) { + sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); + rc = set_attribute(path, state); + if (rc) + return -1; + } + + return 0; +} + +int do_smt(char *state) +{ + int rc = 0; + int smt_state; + + if (!is_smt_capable()) { + fprintf(stderr, "Machine is not SMT capable\n"); + return -1; + } + + if (!state) { + smt_state = get_smt_state(); + + if (smt_state == 1) + printf("SMT is off\n"); + else if (smt_state == threads_per_cpu) + printf("SMT is on\n"); + else if (smt_state == -1) + printf("Inconsistent state: mix of ST and SMT cores\n"); + else + printf("SMT=%d\n", smt_state); + } else { + if (!strcmp(state, "on")) + smt_state = threads_per_cpu; + else if (!strcmp(state, "off")) + smt_state = 1; + else + smt_state = strtol(state, NULL, 0); + + if ((smt_state == 0) || (smt_state > threads_per_cpu)) { + printf("SMT=%s is not valid\n", state); + return -1; + } + + rc = set_smt_state(smt_state); + } + + return rc; +} + +int do_dscr(char *state) +{ + int rc = 0; + + if (!is_dscr_capable()) { + fprintf(stderr, "Machine is not DSCR capable\n"); + return -1; + } + + if (!state) { + int dscr = get_system_attribute("dscr"); + if (dscr == -1) + printf("Inconsistent DSCR\n"); + else + printf("dscr is %d\n", dscr); + } else + rc = set_system_attribute("dscr", strtol(state, NULL, 0)); + + return rc; +} + +int do_smt_snooze_delay(char *state) +{ + int rc = 0; + + if (!is_smt_capable()) { + fprintf(stderr, "Machine is not SMT capable\n"); + return -1; + } + + if (!state) { + int ssd = get_system_attribute("smt_snooze_delay"); + if (ssd == -1) + printf("Inconsistent smt_snooze_delay\n"); + else + printf("smt_snooze_delay is %d\n", ssd); + } else + rc = set_system_attribute("smt_snooze_delay", strtol(state, NULL, 0)); + + return rc; +} + +int do_run_mode(char *run_mode) +{ + char mode[3]; + int rc; + + if (!run_mode) { + rc = rtas_get_sysparm(DIAGNOSTICS_RUN_MODE, 3, mode); + if (rc) { + if (rc == -3) + printf("Machine does not support diagnostic run mode\n"); + else + printf("Could not retrieve current diagnostics mode\n"); + } else + printf("run-mode=%c\n", mode[2]); + } else { + signed char rmode = *run_mode; + + if (rmode < 0 || rmode > 3) { + printf("Invalid run-mode=%c\n", rmode); + return -1; + } + + *(short *)mode = 1; + mode[2] = rmode; + + rc = rtas_set_sysparm(DIAGNOSTICS_RUN_MODE, mode); + if (rc) { + if (rc == -3) + printf("Machine does not support diagnostic run mode\n"); + else + printf("Could not set diagnostics mode\n"); + } + } + + return rc; +} + +void usage(void) +{ + printf("\tppc64_cpu --smt # Get current SMT state\n" + "\tppc64_cpu --smt={on|off} # Turn SMT on/off\n\n" + "\tppc64_cpu --smt=X # Set SMT state to X\n\n" + "\tppc64_cpu --dscr # Get current DSCR setting\n" + "\tppc64_cpu --dscr=<val> # Change DSCR setting\n\n" + "\tppc64_cpu --smt-snooze-delay # Get current smt-snooze-delay setting\n" + "\tppc64_cpu --smt-snooze-delay=<val> # Change smt-snooze-delay setting\n\n" + "\tppc64_cpu --run-mode # Get current diagnostics run mode\n" + "\tppc64_cpu --run-mode=<val> # Set current diagnostics run mode\n\n"); +} + +struct option longopts[] = { + {"smt", optional_argument, NULL, 's'}, + {"dscr", optional_argument, NULL, 'd'}, + {"smt-snooze-delay", optional_argument, NULL, 'S'}, + {"run-mode", optional_argument, NULL, 'r'}, + {0,0,0,0} +}; + +int main(int argc, char *argv[]) +{ + int rc, opt; + int option_index; + + if (argc == 1) { + usage(); + return 0; + } + + threads_per_cpu = get_threads_per_cpu(); + if (threads_per_cpu < 0) { + printf("Could not determine thread count\n"); + return -1; + } + + while (1) { + opt = getopt_long(argc, argv, "s::d::S::r::", longopts, &option_index); + if (opt == -1) + break; + + switch (opt) { + case 's': + rc = do_smt(optarg); + break; + + case 'd': + rc = do_dscr(optarg); + break; + + case 'S': + rc = do_smt_snooze_delay(optarg); + break; + + case 'r': + rc = do_run_mode(optarg); + break; + + default: + usage(); + break; + } + } + + return rc; +} |
From: Nathan F. <nf...@au...> - 2009-07-22 15:04:15
|
The /usr/sbin/rsct/bin/refrsrc command forces a refresh of the HMC/IVM and RMC status after a migration occurs. We should do this from the drmgr command instead of assuming servicelog is installed. A failure to invoke this command can cause additional migrations to be delayed for up to 10 minutes while the framework refreshes itself. The current scenario has the refrsrc command invoked from a servicelog notifier handler. This works in most cases but will cause a delay on systems that do not have servicelog installed. Additionally, one can build drmgr without servicelog support which would cause the notification to never be sent to servicelog even if it is installed. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/drmgr/drmig_chrp_pmig.c =================================================================== --- powerpc-utils.orig/src/drmgr/drmig_chrp_pmig.c 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/src/drmgr/drmig_chrp_pmig.c 2009-07-10 17:01:58.000000000 -0500 @@ -608,6 +608,10 @@ return rc; devtree_update(); + + dbg("Refreshing RMC via refrsrc\n"); + system("/usr/sbin/rsct/bin/refrsrc IBM.ManagementServer"); + #ifdef HAVE_SERVICELOG servicelog_update(sys_src); #endif |
From: Nathan F. <nf...@au...> - 2009-07-16 16:17:11
|
When removing nodes from the device tree in /proc the recusrsive routine can fail with a bad pointer to the DIR struct. The DIR struct should be rewound after each remove to avoid this. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/drmgr/common.c =================================================================== --- powerpc-utils.orig/src/drmgr/common.c 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/src/drmgr/common.c 2009-07-16 15:32:19.000000000 -0500 @@ -427,6 +427,7 @@ DIR *d; struct dirent *de; struct stat sb; + int found = 1; int rc; rc = lstat(path, &sb); @@ -439,28 +440,39 @@ return -1; } - /* Remove any subdirectories */ - while ((de = readdir(d)) != NULL) { + while (found) { char subdir_name[DR_PATH_MAX]; - if (is_dot_dir(de->d_name)) - continue; + found = 0; - sprintf(subdir_name, "%s/%s", path, de->d_name); - rc = lstat(subdir_name, &sb); - if (!rc && (S_ISDIR(sb.st_mode)) && (! S_ISLNK(sb.st_mode))) + /* Remove any subdirectories */ + while ((de = readdir(d)) != NULL) { + if (is_dot_dir(de->d_name)) + continue; + + sprintf(subdir_name, "%s/%s", path, de->d_name); + rc = lstat(subdir_name, &sb); + if (!rc && (S_ISDIR(sb.st_mode)) + && (!S_ISLNK(sb.st_mode))) { + found = 1; + break; + } + } + + if (found) { rc = remove_device_tree_nodes(subdir_name); + rewinddir(d); + } if (rc) break; - } + } closedir(d); - if (rc) - return rc; + if (!rc) + rc = remove_node(path); - rc = remove_node(path); return rc; } |
From: Nathan F. <nf...@au...> - 2009-07-10 20:04:31
|
This patch adds an additional output message when drmgr fails to remove all of the requested lmbs in a drmgr memory remove request. This additional message is meant just to help clarify that the memory remove operations didn't fail, but was unable to completely fulfill the request. This update came as a request from testers. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/drmgr/drslot_chrp_mem.c =================================================================== --- powerpc-utils.orig/src/drmgr/drslot_chrp_mem.c 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/src/drmgr/drslot_chrp_mem.c 2009-07-10 19:10:32.000000000 -0500 @@ -972,6 +972,9 @@ dbg("Removed %d of %d requested lmb(s)\n", lmb_list->lmbs_modified, opts->quantity); + if (lmb_list->lmbs_modified < opts->quantity) + dbg("Unable to hotplug remove the remaining %d lmb(s)\n", + opts->quantity - lmb_list->lmbs_modified); printf("DR_TOTAL_RESOURCES=%d\n", lmb_list->lmbs_modified); free_lmbs(lmb_list); |
From: Nathan F. <nf...@au...> - 2009-07-10 18:26:37
|
After a partition migration a refresh of the RMC framework is needed to avoid having to wait several minutes (5-10) for the framework to refresh itself. This patch adds a refresh directly from the drmgr command. The updates the current mechanism for invoking the refresh. Currently the refresh depends on drmgr being built with servicelog support and having the servicelog and ppc64-diag packages installed. This way ensures that refreshes occur. Signed-off-by: Nathan Fontenot <nf...@au...> -- Index: powerpc-utils/src/drmgr/drmig_chrp_pmig.c =================================================================== --- powerpc-utils.orig/src/drmgr/drmig_chrp_pmig.c 2009-07-10 14:46:25.000000000 -0500 +++ powerpc-utils/src/drmgr/drmig_chrp_pmig.c 2009-07-10 17:01:58.000000000 -0500 @@ -608,6 +608,10 @@ return rc; devtree_update(); + + dbg("Refreshing RMC via refrsrc\n"); + system("/usr/sbin/rsct/bin/refrsrc IBM.ManagementServer"); + #ifdef HAVE_SERVICELOG servicelog_update(sys_src); #endif |
From: Nathan F. <nf...@au...> - 2009-07-10 17:01:59
|
Applied. -Nathan Robert Jennings wrote: > The amsvis command will fail if vio devices have addresses greater than > 30000009 due to a problem with hexidecimal values attempting to be sorted > as long integers. This patch changes the sort to use string comparisions. > > Signed-off-by: Robert Jennings <rc...@li...> > > --- > scripts/amsvis/powerpcAMS/amswidget.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > Index: b/scripts/amsvis/powerpcAMS/amswidget.py > =================================================================== > --- a/scripts/amsvis/powerpcAMS/amswidget.py > +++ b/scripts/amsvis/powerpcAMS/amswidget.py > @@ -675,12 +675,12 @@ class device_data_widget(ams_widget): > def __cmp__(self, other): > """Compare device data widgets to other widgets (or anything). > > - The comparision is based on the nummerical name of the device, which > - is the bus address for the device. > + The comparision is based on the name of the device, which is the > + bus address for the device. > """ > - if (long(self.data[0]["name"])) < other: > + if self.data[0]["name"] < other: > return -1 > - elif (long(self.data[0]["name"])) > other: > + elif self.data[0]["name"] > other: > return 1 > else: > return 0 > |
From: Nathan F. <nf...@au...> - 2009-07-10 16:46:42
|
Applied. -Nathan Robert Jennings wrote: > I'm removing the __date__, __version__, and __source fields from each > of the files. They were filled in by CVS keyword expansion and won't > be updated by GIT. > > Signed-off-by: Robert Jennings <rc...@li...> > > --- > Nathan, I couldn't build the changes, I got an error from ./configure: > configure: error: cannot find install-sh or install.sh in "." "./.." "./../.." > > I'm feeling pretty confident about these changes though. > --- > man/amsstat.1 | 6 ------ > man/amsvis.1 | 6 ------ > scripts/amsstat | 3 --- > scripts/amsvis/amsvis | 4 ---- > scripts/amsvis/powerpcAMS/amsdata.py | 8 ++------ > scripts/amsvis/powerpcAMS/amsnet.py | 4 ---- > scripts/amsvis/powerpcAMS/amswidget.py | 6 +----- > scripts/amsvis/setup.py.in | 4 ---- > 8 files changed, 3 insertions(+), 38 deletions(-) > > Index: b/man/amsstat.1 > =================================================================== > --- a/man/amsstat.1 > +++ b/man/amsstat.1 > @@ -4,10 +4,6 @@ > .\" Author(s) > .\" Robert Jennings <rc...@li...> > .\" > -.\" $Date: 2009/03/18 17:25:35 $ > -.\" $Revision: 1.4 $ > -.\" $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/doc/amsstat.1,v $ > -.\" > .TH AMSSTAT 1 "March 2009" Linux "Linux on Power Service Tools" > .SH NAME > amsstat \- display a list of Active Memory Sharing (AMS) statistics. > @@ -174,5 +170,3 @@ Display a list of AMS statistics and rep > .I /sys/bus/vio/cmo_* > .br > .I /sys/bus/vio/devices/*/cmo_* > -.SH VERSION > -$Revision: 1.4 $ > Index: b/man/amsvis.1 > =================================================================== > --- a/man/amsvis.1 > +++ b/man/amsvis.1 > @@ -4,10 +4,6 @@ > .\" Author(s) > .\" Robert Jennings <rc...@li...> > .\" > -.\" $Date: 2009/03/13 20:27:05 $ > -.\" $Revision: 1.1 $ > -.\" $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/doc/amsvis.1,v $ > -.\" > .TH AMSVIS 1 "January 2009" Linux "Linux on Power Service Tools" > .SH NAME > amsvis \- view Active Memory Sharing (AMS) metrics in a GUI locally or remotely. > @@ -155,5 +151,3 @@ Display the AMS data from the remote sys > .I /sys/bus/vio/devices/*/cmo_* > .SH BUGS > Though not a bug, the name of a number of files and variables are of the form cmo* rather than Active Memory Sharing (AMS). The kernel code for this feature was committed under the name Cooperative Memory Overcommitment (CMO). Kernel support is enabled using the kernel config option CONFIG_PPC_SMLPAR, for shared memory logical partition support. > -.SH VERSION > -$Revision: 1.1 $ > Index: b/scripts/amsstat > =================================================================== > --- a/scripts/amsstat > +++ b/scripts/amsstat > @@ -17,9 +17,6 @@ > # > # For further details on this tool and the fields it displays please > # reference man page amsstat.1 > -# > -# $Date: 2009/04/07 21:22:38 $ > -# $Revision: 1.4 $ > > sleep_interval=$1 > indent=-4 > Index: b/scripts/amsvis/amsvis > =================================================================== > --- a/scripts/amsvis/amsvis > +++ b/scripts/amsvis/amsvis > @@ -10,10 +10,6 @@ __author__ = "Robert Jennings rcj@linux. > __copyright__ = "Copyright (c) 2008 IBM Corporation" > __license__ = "Common Public License v1.0" > > -__version__ = "$Revision: 1.8 $" > -__date__ = "$Date: 2009/02/02 16:52:08 $" > -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/amsvis,v $ > - > import sys > import re > import gobject > Index: b/scripts/amsvis/powerpcAMS/amsdata.py > =================================================================== > --- a/scripts/amsvis/powerpcAMS/amsdata.py > +++ b/scripts/amsvis/powerpcAMS/amsdata.py > @@ -1,17 +1,13 @@ > """Tooling to read/parse AMS-related data from system files in /proc and /sys. > > -The data can be read by calling gather_all_data() and is returned as a 3-tuple of > -dictionaries for system data, bus data, and data for devices. > +The data can be read by calling gather_all_data() and is returned as a > +3-tuple of dictionaries for system data, bus data, and data for devices. > """ > > __author__ = "Robert Jennings rc...@li..." > __copyright__ = "Copyright (c) 2008 IBM Corporation" > __license__ = "Common Public License v1.0" > > -__version__ = "$Revision: 1.5 $" > -__date__ = "$Date: 2009/01/20 21:28:29 $" > -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amsdata.py,v $ > - > import os > import sys > import logging > Index: b/scripts/amsvis/powerpcAMS/amsnet.py > =================================================================== > --- a/scripts/amsvis/powerpcAMS/amsnet.py > +++ b/scripts/amsvis/powerpcAMS/amsnet.py > @@ -5,10 +5,6 @@ __author__ = "Robert Jennings rcj@linux. > __copyright__ = "Copyright (c) 2008 IBM Corporation" > __license__ = "Common Public License v1.0" > > -__version__ = "$Revision: 1.3 $" > -__date__ = "$Date: 2009/01/16 16:39:10 $" > -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amsnet.py,v $ > - > import socket > import sys > import os > Index: b/scripts/amsvis/powerpcAMS/amswidget.py > =================================================================== > --- a/scripts/amsvis/powerpcAMS/amswidget.py > +++ b/scripts/amsvis/powerpcAMS/amswidget.py > @@ -1,14 +1,10 @@ > -"""bar.py test script for drawing a bar readout > +"""AMS widget class and subclasses for drawing AMS data > """ > > __author__ = "Robert Jennings rc...@li..." > __copyright__ = "Copyright (c) 2008 IBM Corporation" > __license__ = "Common Public License v1.0" > > -__version__ = "$Revision: 1.6 $" > -__date__ = "$Date: 2009/01/21 15:38:20 $" > -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amswidget.py,v $ > - > import gtk > from gtk import gdk > import cairo > Index: b/scripts/amsvis/setup.py.in > =================================================================== > --- a/scripts/amsvis/setup.py.in > +++ b/scripts/amsvis/setup.py.in > @@ -5,10 +5,6 @@ __author__ = "Robert Jennings rcj@linux. > __copyright__ = "Copyright (c) 2008 IBM Corporation" > __license__ = "Common Public License v1.0" > > -__version__ = "$Revision: 1.2 $" > -__date__ = "$Date: 2009/01/08 17:43:16 $" > -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/setup.py,v $ > - > from distutils.core import setup > import os > > > ------------------------------------------------------------------------------ > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Robert J. <rc...@li...> - 2009-07-01 16:23:11
|
I'm removing the __date__, __version__, and __source fields from each of the files. They were filled in by CVS keyword expansion and won't be updated by GIT. Signed-off-by: Robert Jennings <rc...@li...> --- Nathan, I couldn't build the changes, I got an error from ./configure: configure: error: cannot find install-sh or install.sh in "." "./.." "./../.." I'm feeling pretty confident about these changes though. --- man/amsstat.1 | 6 ------ man/amsvis.1 | 6 ------ scripts/amsstat | 3 --- scripts/amsvis/amsvis | 4 ---- scripts/amsvis/powerpcAMS/amsdata.py | 8 ++------ scripts/amsvis/powerpcAMS/amsnet.py | 4 ---- scripts/amsvis/powerpcAMS/amswidget.py | 6 +----- scripts/amsvis/setup.py.in | 4 ---- 8 files changed, 3 insertions(+), 38 deletions(-) Index: b/man/amsstat.1 =================================================================== --- a/man/amsstat.1 +++ b/man/amsstat.1 @@ -4,10 +4,6 @@ .\" Author(s) .\" Robert Jennings <rc...@li...> .\" -.\" $Date: 2009/03/18 17:25:35 $ -.\" $Revision: 1.4 $ -.\" $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/doc/amsstat.1,v $ -.\" .TH AMSSTAT 1 "March 2009" Linux "Linux on Power Service Tools" .SH NAME amsstat \- display a list of Active Memory Sharing (AMS) statistics. @@ -174,5 +170,3 @@ Display a list of AMS statistics and rep .I /sys/bus/vio/cmo_* .br .I /sys/bus/vio/devices/*/cmo_* -.SH VERSION -$Revision: 1.4 $ Index: b/man/amsvis.1 =================================================================== --- a/man/amsvis.1 +++ b/man/amsvis.1 @@ -4,10 +4,6 @@ .\" Author(s) .\" Robert Jennings <rc...@li...> .\" -.\" $Date: 2009/03/13 20:27:05 $ -.\" $Revision: 1.1 $ -.\" $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/doc/amsvis.1,v $ -.\" .TH AMSVIS 1 "January 2009" Linux "Linux on Power Service Tools" .SH NAME amsvis \- view Active Memory Sharing (AMS) metrics in a GUI locally or remotely. @@ -155,5 +151,3 @@ Display the AMS data from the remote sys .I /sys/bus/vio/devices/*/cmo_* .SH BUGS Though not a bug, the name of a number of files and variables are of the form cmo* rather than Active Memory Sharing (AMS). The kernel code for this feature was committed under the name Cooperative Memory Overcommitment (CMO). Kernel support is enabled using the kernel config option CONFIG_PPC_SMLPAR, for shared memory logical partition support. -.SH VERSION -$Revision: 1.1 $ Index: b/scripts/amsstat =================================================================== --- a/scripts/amsstat +++ b/scripts/amsstat @@ -17,9 +17,6 @@ # # For further details on this tool and the fields it displays please # reference man page amsstat.1 -# -# $Date: 2009/04/07 21:22:38 $ -# $Revision: 1.4 $ sleep_interval=$1 indent=-4 Index: b/scripts/amsvis/amsvis =================================================================== --- a/scripts/amsvis/amsvis +++ b/scripts/amsvis/amsvis @@ -10,10 +10,6 @@ __author__ = "Robert Jennings rcj@linux. __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" -__version__ = "$Revision: 1.8 $" -__date__ = "$Date: 2009/02/02 16:52:08 $" -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/amsvis,v $ - import sys import re import gobject Index: b/scripts/amsvis/powerpcAMS/amsdata.py =================================================================== --- a/scripts/amsvis/powerpcAMS/amsdata.py +++ b/scripts/amsvis/powerpcAMS/amsdata.py @@ -1,17 +1,13 @@ """Tooling to read/parse AMS-related data from system files in /proc and /sys. -The data can be read by calling gather_all_data() and is returned as a 3-tuple of -dictionaries for system data, bus data, and data for devices. +The data can be read by calling gather_all_data() and is returned as a +3-tuple of dictionaries for system data, bus data, and data for devices. """ __author__ = "Robert Jennings rc...@li..." __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" -__version__ = "$Revision: 1.5 $" -__date__ = "$Date: 2009/01/20 21:28:29 $" -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amsdata.py,v $ - import os import sys import logging Index: b/scripts/amsvis/powerpcAMS/amsnet.py =================================================================== --- a/scripts/amsvis/powerpcAMS/amsnet.py +++ b/scripts/amsvis/powerpcAMS/amsnet.py @@ -5,10 +5,6 @@ __author__ = "Robert Jennings rcj@linux. __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" -__version__ = "$Revision: 1.3 $" -__date__ = "$Date: 2009/01/16 16:39:10 $" -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amsnet.py,v $ - import socket import sys import os Index: b/scripts/amsvis/powerpcAMS/amswidget.py =================================================================== --- a/scripts/amsvis/powerpcAMS/amswidget.py +++ b/scripts/amsvis/powerpcAMS/amswidget.py @@ -1,14 +1,10 @@ -"""bar.py test script for drawing a bar readout +"""AMS widget class and subclasses for drawing AMS data """ __author__ = "Robert Jennings rc...@li..." __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" -__version__ = "$Revision: 1.6 $" -__date__ = "$Date: 2009/01/21 15:38:20 $" -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/powerpcAMS/amswidget.py,v $ - import gtk from gtk import gdk import cairo Index: b/scripts/amsvis/setup.py.in =================================================================== --- a/scripts/amsvis/setup.py.in +++ b/scripts/amsvis/setup.py.in @@ -5,10 +5,6 @@ __author__ = "Robert Jennings rcj@linux. __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" -__version__ = "$Revision: 1.2 $" -__date__ = "$Date: 2009/01/08 17:43:16 $" -# $Source: /cvsroot/powerpc-utils/powerpc-utils-papr/scripts/amsvis/setup.py,v $ - from distutils.core import setup import os |
From: Robert J. <rc...@li...> - 2009-07-01 15:53:16
|
The amsvis command will fail if vio devices have addresses greater than 30000009 due to a problem with hexidecimal values attempting to be sorted as long integers. This patch changes the sort to use string comparisions. Signed-off-by: Robert Jennings <rc...@li...> --- scripts/amsvis/powerpcAMS/amswidget.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: b/scripts/amsvis/powerpcAMS/amswidget.py =================================================================== --- a/scripts/amsvis/powerpcAMS/amswidget.py +++ b/scripts/amsvis/powerpcAMS/amswidget.py @@ -675,12 +675,12 @@ class device_data_widget(ams_widget): def __cmp__(self, other): """Compare device data widgets to other widgets (or anything). - The comparision is based on the nummerical name of the device, which - is the bus address for the device. + The comparision is based on the name of the device, which is the + bus address for the device. """ - if (long(self.data[0]["name"])) < other: + if self.data[0]["name"] < other: return -1 - elif (long(self.data[0]["name"])) > other: + elif self.data[0]["name"] > other: return 1 else: return 0 -- |