forked from Imagelibrary/rtems
2006-08-30 Joel Sherrill <joel@OARcorp.com>
* libmisc/cpuuse/cpuuse.c, libmisc/monitor/mon-command.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-symbols.c, libmisc/rtmonuse/rtmonuse.c, libmisc/stackchk/check.c, libnetworking/libc/res_debug.c, telnetd/telnetd.c: Remove printf format warnings.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2006-08-30 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* libmisc/cpuuse/cpuuse.c, libmisc/monitor/mon-command.c,
|
||||||
|
libmisc/monitor/mon-driver.c, libmisc/monitor/mon-symbols.c,
|
||||||
|
libmisc/rtmonuse/rtmonuse.c, libmisc/stackchk/check.c,
|
||||||
|
libnetworking/libc/res_debug.c, telnetd/telnetd.c: Remove printf
|
||||||
|
format warnings.
|
||||||
|
|
||||||
2006-08-30 Joel Sherrill <joel@OARcorp.com>
|
2006-08-30 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* libcsupport/src/utsname.c, libnetworking/libc/res_debug.c,
|
* libcsupport/src/utsname.c, libnetworking/libc/res_debug.c,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <rtems/cpuuse.h>
|
#include <rtems/cpuuse.h>
|
||||||
|
|
||||||
@@ -98,25 +99,28 @@ void CPU_usage_Dump( void )
|
|||||||
if ( !isprint(name[2]) ) name[2] = '*';
|
if ( !isprint(name[2]) ) name[2] = '*';
|
||||||
if ( !isprint(name[3]) ) name[3] = '*';
|
if ( !isprint(name[3]) ) name[3] = '*';
|
||||||
|
|
||||||
ival = total_units ? the_thread->ticks_executed * 10000 / total_units : 0;
|
ival = total_units ?
|
||||||
fval = ival % 100;
|
the_thread->ticks_executed * 10000 / total_units : 0;
|
||||||
ival /= 100;
|
fval = ival % 100;
|
||||||
fprintf(stdout, "0x%08x %4s %8d %3d.%2.2d\n",
|
ival /= 100;
|
||||||
|
fprintf(stdout,
|
||||||
|
"0x%08" PRIu32 " %4s %8" PRId32 " %3" PRId32
|
||||||
|
".%2.2" PRId32"\n",
|
||||||
the_thread->Object.id,
|
the_thread->Object.id,
|
||||||
name,
|
name,
|
||||||
the_thread->ticks_executed,
|
the_thread->ticks_executed,
|
||||||
ival,
|
ival,
|
||||||
fval
|
fval
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"\nTicks since last reset = %d\n",
|
"\nTicks since last reset = %" PRId32 "\n",
|
||||||
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
|
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
|
||||||
);
|
);
|
||||||
fprintf(stdout, "\nTotal Units = %d\n", total_units );
|
fprintf(stdout, "\nTotal Units = %" PRId32 "\n", total_units );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#ifndef MONITOR_PROMPT
|
#ifndef MONITOR_PROMPT
|
||||||
#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
|
#define MONITOR_PROMPT "rtems" /* will have '> ' appended */
|
||||||
@@ -496,11 +497,11 @@ rtems_monitor_command_read(char *command,
|
|||||||
sprintf (monitor_prompt, "%s",
|
sprintf (monitor_prompt, "%s",
|
||||||
(env_prompt == NULL) ? MONITOR_PROMPT: env_prompt);
|
(env_prompt == NULL) ? MONITOR_PROMPT: env_prompt);
|
||||||
else if (rtems_monitor_default_node != rtems_monitor_node)
|
else if (rtems_monitor_default_node != rtems_monitor_node)
|
||||||
sprintf (monitor_prompt, "%d-%s-%d", rtems_monitor_node,
|
sprintf (monitor_prompt, "%" PRId32 "-%s-%" PRId32 "", rtems_monitor_node,
|
||||||
(env_prompt == NULL) ? MONITOR_PROMPT : env_prompt,
|
(env_prompt == NULL) ? MONITOR_PROMPT : env_prompt,
|
||||||
rtems_monitor_default_node);
|
rtems_monitor_default_node);
|
||||||
else
|
else
|
||||||
sprintf (monitor_prompt, "%d-%s", rtems_monitor_node,
|
sprintf (monitor_prompt, "%" PRId32 "-%s", rtems_monitor_node,
|
||||||
(env_prompt == NULL) ? MONITOR_PROMPT : env_prompt);
|
(env_prompt == NULL) ? MONITOR_PROMPT : env_prompt);
|
||||||
|
|
||||||
#if defined(RTEMS_UNIX)
|
#if defined(RTEMS_UNIX)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> /* strtoul() */
|
#include <stdlib.h> /* strtoul() */
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#define DATACOL 15
|
#define DATACOL 15
|
||||||
#define CONTCOL DATACOL /* continued col */
|
#define CONTCOL DATACOL /* continued col */
|
||||||
@@ -110,7 +111,7 @@ rtems_monitor_driver_dump(
|
|||||||
{
|
{
|
||||||
uint32_t length = 0;
|
uint32_t length = 0;
|
||||||
|
|
||||||
length += fprintf(stdout," %d", monitor_driver->id);
|
length += fprintf(stdout," %" PRId32 "", monitor_driver->id);
|
||||||
|
|
||||||
length += rtems_monitor_pad(13, length);
|
length += rtems_monitor_pad(13, length);
|
||||||
length += fprintf(stdout,"init: ");
|
length += fprintf(stdout,"init: ");
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <rtems/monitor.h>
|
#include <rtems/monitor.h>
|
||||||
#include "symbols.h"
|
#include "symbols.h"
|
||||||
@@ -400,15 +401,16 @@ rtems_monitor_symbol_dump(
|
|||||||
(int) sizeof(canonical_symbol->name),
|
(int) sizeof(canonical_symbol->name),
|
||||||
canonical_symbol->name);
|
canonical_symbol->name);
|
||||||
else
|
else
|
||||||
length += fprintf(stdout,"<%.*s+0x%x>",
|
length += fprintf(stdout,"<%.*s+0x%" PRIx32 ">",
|
||||||
(int) sizeof(canonical_symbol->name),
|
(int) sizeof(canonical_symbol->name),
|
||||||
canonical_symbol->name,
|
canonical_symbol->name,
|
||||||
canonical_symbol->offset);
|
canonical_symbol->offset);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
length += fprintf(stdout," [0x%x]", canonical_symbol->value);
|
length += fprintf(stdout,
|
||||||
|
" [0x%" PRIx32 "]", canonical_symbol->value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
length += fprintf(stdout,"[0x%x]", canonical_symbol->value);
|
length += fprintf(stdout,"[0x%" PRIx32 "]", canonical_symbol->value);
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <rtems/rtmonuse.h>
|
#include <rtems/rtmonuse.h>
|
||||||
|
|
||||||
@@ -192,7 +193,8 @@ void Period_usage_Dump( void )
|
|||||||
|
|
||||||
|
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
|
"0x%08" PRIx32 " %4s %6" PRId32 " %3" PRId32 " %" PRId32
|
||||||
|
"/%" PRId32 "/%5.2f %" PRId32 "/%" PRId32 "/%3.2f\n",
|
||||||
the_usage->id,
|
the_usage->id,
|
||||||
name,
|
name,
|
||||||
the_usage->count,
|
the_usage->count,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HACK
|
* HACK
|
||||||
@@ -315,17 +316,18 @@ void Stack_check_report_blown_task(void)
|
|||||||
|
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr,
|
stderr,
|
||||||
"BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x",
|
"BLOWN STACK!!! Offending task(%p): id=0x%08" PRIx32
|
||||||
|
"; name=0x%08" PRIx32,
|
||||||
running,
|
running,
|
||||||
running->Object.id,
|
running->Object.id,
|
||||||
(uint32_t )running->Object.name
|
(uint32_t) running->Object.name
|
||||||
);
|
);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
if (rtems_configuration_get_user_multiprocessing_table())
|
if (rtems_configuration_get_user_multiprocessing_table())
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr,
|
stderr,
|
||||||
"; node=%d\n",
|
"; node=%" PRId32 "\n",
|
||||||
rtems_configuration_get_user_multiprocessing_table()->node
|
rtems_configuration_get_user_multiprocessing_table()->node
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
@@ -334,10 +336,10 @@ void Stack_check_report_blown_task(void)
|
|||||||
|
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr,
|
stderr,
|
||||||
" stack covers range 0x%08x - 0x%08x (%d bytes)\n",
|
" stack covers range %p - %p" PRIx32 " (%" PRId32 " bytes)\n",
|
||||||
(uint32_t ) stack->area,
|
stack->area,
|
||||||
(uint32_t ) stack->area + stack->size - 1,
|
stack->area + stack->size - 1,
|
||||||
(uint32_t ) stack->size);
|
stack->size);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
fprintf(
|
fprintf(
|
||||||
@@ -480,11 +482,12 @@ void Stack_check_Dump_threads_usage(
|
|||||||
name[ 4 ] = '\0';
|
name[ 4 ] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stdout, "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
|
fprintf(stdout, "0x%08" PRIx32 " %4s %p - %p"
|
||||||
|
" %8" PRId32 " %8" PRId32 "\n",
|
||||||
the_thread ? the_thread->Object.id : ~0,
|
the_thread ? the_thread->Object.id : ~0,
|
||||||
name,
|
name,
|
||||||
(uint32_t ) stack->area,
|
stack->area,
|
||||||
(uint32_t ) stack->area + (uint32_t ) stack->size - 1,
|
stack->area + stack->size - 1,
|
||||||
size,
|
size,
|
||||||
used
|
used
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ p_time(u_int32_t value) {
|
|||||||
static char nbuf[40];
|
static char nbuf[40];
|
||||||
|
|
||||||
if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
|
if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
|
||||||
sprintf(nbuf, "%" PRIu32, value);
|
sprintf(nbuf, "%" PRIu32, (uint32_t) value);
|
||||||
return (nbuf);
|
return (nbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h> /* memset */
|
#include <string.h> /* memset */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
/* FIXME: This should not be here */
|
/* FIXME: This should not be here */
|
||||||
extern void _rtems_telnetd_register_icmds(void);
|
extern void _rtems_telnetd_register_icmds(void);
|
||||||
@@ -124,8 +125,10 @@ int rtems_telnetd_main(int argc,char * argv[]) {
|
|||||||
if (argc>2) telnetd_task_priority=str2int(argv[2]);
|
if (argc>2) telnetd_task_priority=str2int(argv[2]);
|
||||||
sc=rtems_initialize_telnetd();
|
sc=rtems_initialize_telnetd();
|
||||||
if (sc!=RTEMS_SUCCESSFUL) return sc;
|
if (sc!=RTEMS_SUCCESSFUL) return sc;
|
||||||
printf("rtems_telnetd() started with stacksize=%u,priority=%d\n",
|
printf(
|
||||||
telnetd_stack_size,telnetd_task_priority);
|
"rtems_telnetd() started with stacksize=%" PRIu32
|
||||||
|
",priority=%" PRId32 "\n",
|
||||||
|
telnetd_stack_size,telnetd_task_priority);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user