|
From: Nicholas N. <nj...@ca...> - 2004-06-21 12:42:46
|
CVS commit by nethercote:
Renamed the following options:
--logfile-fd --> --log-fd
--logfile --> --log-file
--logsocket --> --log-socket
to be consistent with each other and other options (esp. --input-fd). Also
renamed some related variables. The old names still work, for backwards
compatibility, but they're not documented.
M +1 -1 FAQ.txt 1.22
M +11 -11 coregrind/vg_include.h 1.195
M +62 -48 coregrind/vg_main.c 1.156
M +5 -5 coregrind/vg_messages.c 1.10
M +2 -2 coregrind/vg_mylibc.c 1.73
M +2 -2 coregrind/vg_signals.c 1.70
M +4 -6 coregrind/vg_syscalls.c 1.102
M +11 -11 coregrind/docs/coregrind_core.html 1.30
M +2 -2 include/vg_skin.h.base 1.21
M +1 -1 memcheck/tests/error_counts.vgtest 1.2
M +3 -3 none/tests/cmdline1.stdout.exp 1.4
M +3 -3 none/tests/cmdline2.stdout.exp 1.4
--- valgrind/FAQ.txt #1.21:1.22
@@ -344,5 +344,5 @@
If you are tracing large trees of processes, it can be less disruptive
to have the output sent over the network. Give Valgrind the flag
---logsocket=127.0.0.1:12345 (if you want logging output sent to port
+--log-socket=127.0.0.1:12345 (if you want logging output sent to port
12345 on localhost). You can use the valgrind-listener program to
listen on that port:
--- valgrind/coregrind/vg_include.h #1.194:1.195
@@ -198,22 +198,22 @@ extern Bool VG_(clo_trace_children);
/* Where logging output is to be sent to.
- When log_to == VgLogTo_Fd, clo_logfile_fd holds the file id, and is
- taken from the command line. clo_logfile_name is irrelevant.
+ When log_to == VgLogTo_Fd, clo_log_fd holds the file id, and is
+ taken from the command line. clo_log_name is irrelevant.
- When log_to == VgLogTo_File, clo_logfile_name holds the logfile
- name, and is taken from the command line. clo_logfile_fd is then
- made to hold the relevant file id, by opening clo_logfile_name
+ When log_to == VgLogTo_File, clo_log_name holds the log-file
+ name, and is taken from the command line. clo_log_fd is then
+ made to hold the relevant file id, by opening clo_log_name
(concatenated with the process ID) for writing.
- When log_to == VgLogTo_Socket, clo_logfile_name holds the
+ When log_to == VgLogTo_Socket, clo_log_name holds the
hostname:portnumber pair, and is taken from the command line.
- clo_logfile_fd is then made to hold the relevant file handle, by
+ clo_log_fd is then made to hold the relevant file handle, by
opening a connection to said hostname:portnumber pair.
- Global default is to set log_to == VgLogTo_Fd and logfile_fd == 2
+ Global default is to set log_to == VgLogTo_Fd and log_fd == 2
(stderr). */
extern VgLogTo VG_(clo_log_to);
-extern Int VG_(clo_logfile_fd);
-extern Char* VG_(clo_logfile_name);
+extern Int VG_(clo_log_fd);
+extern Char* VG_(clo_log_name);
/* The file descriptor to read for input. default: 0 == stdin */
@@ -282,5 +282,5 @@ extern void VG_(intercept_libc_freeres_w
------------------------------------------------------------------ */
-/* Create a logfile into which messages can be dumped. */
+/* Create a log file into which messages can be dumped. */
extern void VG_(startup_logging) ( void );
extern void VG_(shutdown_logging)( void );
--- valgrind/coregrind/vg_main.c #1.155:1.156
@@ -1368,5 +1368,5 @@ static void abort_msg ( void )
{
VG_(clo_log_to) = VgLogTo_Fd;
- VG_(clo_logfile_fd) = 2; /* stderr */
+ VG_(clo_log_fd) = 2; /* stderr */
}
@@ -1466,6 +1466,6 @@ Bool VG_(clo_trace_children) = False;
immediately afterwards. */
VgLogTo VG_(clo_log_to) = VgLogTo_Fd;
-Int VG_(clo_logfile_fd) = 1;
-Char* VG_(clo_logfile_name) = NULL;
+Int VG_(clo_log_fd) = 1;
+Char* VG_(clo_log_name) = NULL;
Int VG_(clo_input_fd) = 0; /* stdin */
@@ -1532,7 +1532,7 @@ void usage ( Bool debug_help )
"\n"
" user options for Valgrind tools that report errors:\n"
-" --logfile-fd=<number> file descriptor for messages [2=stderr]\n"
-" --logfile=<file> log messages to <file>.pid<pid>\n"
-" --logsocket=ipaddr:port log messages to socket ipaddr:port\n"
+" --log-fd=<number> log messages to file descriptor [2=stderr]\n"
+" --log-file=<file> log messages to <file>.pid<pid>\n"
+" --log-socket=ipaddr:port log messages to socket ipaddr:port\n"
" --demangle=no|yes automatically demangle C++ names? [yes]\n"
" --num-callers=<number> show <num> callers in stack traces [4]\n"
@@ -1648,10 +1647,10 @@ static void process_cmd_line_options
( UInt* client_auxv, Addr esp_at_startup, const char* toolname )
{
- Int i, eventually_logfile_fd;
+ Int i, eventually_log_fd;
Int *auxp;
Int toolname_len = VG_(strlen)(toolname);
/* log to stderr by default, but usage message goes to stdout */
- eventually_logfile_fd = 2;
+ eventually_log_fd = 2;
/* Check for sane path in ./configure --prefix=... */
@@ -1749,18 +1748,34 @@ static void process_cmd_line_options
VG_DEEPEST_BACKTRACE)
+ // for backwards compatibility, replaced by --log-fd
else if (VG_CLO_STREQN(13, arg, "--logfile-fd=")) {
VG_(clo_log_to) = VgLogTo_Fd;
- VG_(clo_logfile_name) = NULL;
- eventually_logfile_fd = (Int)VG_(atoll)(&arg[13]);
+ VG_(clo_log_name) = NULL;
+ eventually_log_fd = (Int)VG_(atoll)(&arg[13]);
+ }
+ else if (VG_CLO_STREQN(9, arg, "--log-fd=")) {
+ VG_(clo_log_to) = VgLogTo_Fd;
+ VG_(clo_log_name) = NULL;
+ eventually_log_fd = (Int)VG_(atoll)(&arg[9]);
}
+ // for backwards compatibility, replaced by --log-file
else if (VG_CLO_STREQN(10, arg, "--logfile=")) {
VG_(clo_log_to) = VgLogTo_File;
- VG_(clo_logfile_name) = &arg[10];
+ VG_(clo_log_name) = &arg[10];
+ }
+ else if (VG_CLO_STREQN(11, arg, "--log-file=")) {
+ VG_(clo_log_to) = VgLogTo_File;
+ VG_(clo_log_name) = &arg[11];
}
+ // for backwards compatibility, replaced by --log-socket
else if (VG_CLO_STREQN(12, arg, "--logsocket=")) {
VG_(clo_log_to) = VgLogTo_Socket;
- VG_(clo_logfile_name) = &arg[12];
+ VG_(clo_log_name) = &arg[12];
+ }
+ else if (VG_CLO_STREQN(13, arg, "--log-socket=")) {
+ VG_(clo_log_to) = VgLogTo_Socket;
+ VG_(clo_log_name) = &arg[13];
}
@@ -1824,5 +1839,5 @@ static void process_cmd_line_options
}
- /* Set up logging now. After this is done, VG_(clo_logfile_fd)
+ /* Set up logging now. After this is done, VG_(clo_log_fd)
should be connected to whatever sink has been selected, and we
indiscriminately chuck stuff into it without worrying what the
@@ -1832,5 +1847,5 @@ static void process_cmd_line_options
the terminal any problems to do with processing command line
opts. */
- vg_assert(VG_(clo_logfile_fd) == 1 /* stdout */);
+ vg_assert(VG_(clo_log_fd) == 1 /* stdout */);
vg_assert(VG_(logging_to_filedes) == True);
@@ -1838,6 +1853,6 @@ static void process_cmd_line_options
case VgLogTo_Fd:
- vg_assert(VG_(clo_logfile_name) == NULL);
- VG_(clo_logfile_fd) = eventually_logfile_fd;
+ vg_assert(VG_(clo_log_name) == NULL);
+ VG_(clo_log_fd) = eventually_log_fd;
break;
@@ -1847,30 +1862,30 @@ static void process_cmd_line_options
Int pid = VG_(getpid)();
- vg_assert(VG_(clo_logfile_name) != NULL);
- vg_assert(VG_(strlen)(VG_(clo_logfile_name)) <= 900); /* paranoia */
+ vg_assert(VG_(clo_log_name) != NULL);
+ vg_assert(VG_(strlen)(VG_(clo_log_name)) <= 900); /* paranoia */
for (;;) {
if (seq == 0)
VG_(sprintf)(logfilename, "%s.pid%d",
- VG_(clo_logfile_name), pid );
+ VG_(clo_log_name), pid );
else
VG_(sprintf)(logfilename, "%s.pid%d.%d",
- VG_(clo_logfile_name), pid, seq );
+ VG_(clo_log_name), pid, seq );
seq++;
- eventually_logfile_fd
+ eventually_log_fd
= VG_(open)(logfilename,
VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,
VKI_S_IRUSR|VKI_S_IWUSR);
- if (eventually_logfile_fd >= 0) {
- VG_(clo_logfile_fd) = VG_(safe_fd)(eventually_logfile_fd);
+ if (eventually_log_fd >= 0) {
+ VG_(clo_log_fd) = VG_(safe_fd)(eventually_log_fd);
break;
} else {
- if (eventually_logfile_fd != -VKI_EEXIST) {
+ if (eventually_log_fd != -VKI_EEXIST) {
VG_(message)(Vg_UserMsg,
"Can't create/open log file `%s.pid%d'; giving up!",
- VG_(clo_logfile_name), pid);
+ VG_(clo_log_name), pid);
VG_(bad_option)(
- "--logfile=<file> didn't work out for some reason.");
+ "--log-file=<file> didn't work out for some reason.");
break;
}
@@ -1881,20 +1896,19 @@ static void process_cmd_line_options
case VgLogTo_Socket: {
- vg_assert(VG_(clo_logfile_name) != NULL);
- vg_assert(VG_(strlen)(VG_(clo_logfile_name)) <= 900); /* paranoia */
- eventually_logfile_fd
- = VG_(connect_via_socket)( VG_(clo_logfile_name) );
- if (eventually_logfile_fd == -1) {
+ vg_assert(VG_(clo_log_name) != NULL);
+ vg_assert(VG_(strlen)(VG_(clo_log_name)) <= 900); /* paranoia */
+ eventually_log_fd = VG_(connect_via_socket)( VG_(clo_log_name) );
+ if (eventually_log_fd == -1) {
VG_(message)(Vg_UserMsg,
- "Invalid --logsocket=ipaddr or --logsocket=ipaddr:port spec");
+ "Invalid --log-socket=ipaddr or --log-socket=ipaddr:port spec");
VG_(message)(Vg_UserMsg,
- "of `%s'; giving up!", VG_(clo_logfile_name) );
+ "of `%s'; giving up!", VG_(clo_log_name) );
VG_(bad_option)(
- "--logsocket=");
+ "--log-socket=");
}
- if (eventually_logfile_fd == -2) {
+ if (eventually_log_fd == -2) {
VG_(message)(Vg_UserMsg,
"valgrind: failed to connect to logging server `%s'.",
- VG_(clo_logfile_name) );
+ VG_(clo_log_name) );
VG_(message)(Vg_UserMsg,
"Log messages will sent to stderr instead." );
@@ -1903,6 +1917,6 @@ static void process_cmd_line_options
/* We don't change anything here. */
} else {
- vg_assert(eventually_logfile_fd > 0);
- VG_(clo_logfile_fd) = eventually_logfile_fd;
+ vg_assert(eventually_log_fd > 0);
+ VG_(clo_log_fd) = eventually_log_fd;
VG_(logging_to_filedes) = False;
}
@@ -1912,11 +1926,11 @@ static void process_cmd_line_options
}
- /* Move logfile_fd into the safe range, so it doesn't conflict with any app fds */
- eventually_logfile_fd = VG_(fcntl)(VG_(clo_logfile_fd), VKI_F_DUPFD, VG_(max_fd)+1);
- if (eventually_logfile_fd < 0)
+ /* Move log_fd into the safe range, so it doesn't conflict with any app fds */
+ eventually_log_fd = VG_(fcntl)(VG_(clo_log_fd), VKI_F_DUPFD, VG_(max_fd)+1);
+ if (eventually_log_fd < 0)
VG_(message)(Vg_UserMsg, "valgrind: failed to move logfile fd into safe range");
else {
- VG_(clo_logfile_fd) = eventually_logfile_fd;
- VG_(fcntl)(VG_(clo_logfile_fd), VKI_F_SETFD, VKI_FD_CLOEXEC);
+ VG_(clo_log_fd) = eventually_log_fd;
+ VG_(fcntl)(VG_(clo_log_fd), VKI_F_SETFD, VKI_FD_CLOEXEC);
}
--- valgrind/coregrind/vg_messages.c #1.9:1.10
@@ -98,5 +98,5 @@ int VG_(end_msg) ( void )
{
int count = 0;
- if (VG_(clo_logfile_fd) >= 0) {
+ if (VG_(clo_log_fd) >= 0) {
add_to_buf('\n');
VG_(send_bytes_to_logging_sink) (
@@ -113,7 +113,7 @@ void VG_(send_bytes_to_logging_sink) ( C
Int rc;
if (VG_(logging_to_filedes)) {
- VG_(write)( VG_(clo_logfile_fd), msg, nbytes );
+ VG_(write)( VG_(clo_log_fd), msg, nbytes );
} else {
- rc = VG_(write_socket)( VG_(clo_logfile_fd), msg, nbytes );
+ rc = VG_(write_socket)( VG_(clo_log_fd), msg, nbytes );
if (rc == -1) {
/* for example, the listener process died. Switch back to
@@ -121,6 +121,6 @@ void VG_(send_bytes_to_logging_sink) ( C
VG_(logging_to_filedes) = True;
VG_(clo_log_to) = VgLogTo_Fd;
- VG_(clo_logfile_fd) = 2;
- VG_(write)( VG_(clo_logfile_fd), msg, nbytes );
+ VG_(clo_log_fd) = 2;
+ VG_(write)( VG_(clo_log_fd), msg, nbytes );
}
}
--- valgrind/coregrind/vg_mylibc.c #1.72:1.73
@@ -701,5 +701,5 @@ static void add_to_myprintf_buf ( Char c
{
if (n_myprintf_buf >= 100-10 /*paranoia*/ ) {
- if (VG_(clo_logfile_fd) >= 0) {
+ if (VG_(clo_log_fd) >= 0) {
VG_(send_bytes_to_logging_sink)(
myprintf_buf, VG_(strlen)(myprintf_buf) );
@@ -722,5 +722,5 @@ UInt VG_(printf) ( const char *format, .
ret = VG_(vprintf) ( add_to_myprintf_buf, format, vargs );
- if (n_myprintf_buf > 0 && VG_(clo_logfile_fd) >= 0) {
+ if (n_myprintf_buf > 0 && VG_(clo_log_fd) >= 0) {
VG_(send_bytes_to_logging_sink)( myprintf_buf, n_myprintf_buf );
}
--- valgrind/coregrind/vg_signals.c #1.69:1.70
@@ -1556,7 +1556,7 @@ static void make_coredump(ThreadId tid,
struct elf_prstatus prstatus;
- if (VG_(clo_logfile_name) != NULL) {
+ if (VG_(clo_log_name) != NULL) {
coreext = ".core";
- basename = VG_(clo_logfile_name);
+ basename = VG_(clo_log_name);
}
--- valgrind/coregrind/vg_syscalls.c #1.101:1.102
@@ -1058,12 +1058,11 @@ static Addr do_brk(Addr newbrk)
static Bool fd_allowed(Int fd, const Char *syscall, ThreadId tid)
{
- if (fd < 0 || fd > VG_(max_fd) || fd == VG_(clo_logfile_fd)) {
+ if (fd < 0 || fd > VG_(max_fd) || fd == VG_(clo_log_fd)) {
VG_(message)(Vg_UserMsg,
"Warning: invalid file descriptor %d in syscall %s()",
fd, syscall);
- if (fd == VG_(clo_logfile_fd))
+ if (fd == VG_(clo_log_fd))
VG_(message)(Vg_UserMsg,
- " Use --logfile-fd=<number> to select an alternative "
- "logfile fd.");
+ " Use --log-fd=<number> to select an alternative log fd.");
if (VG_(clo_verbosity) > 1) {
ExeContext *ec = VG_(get_ExeContext)(tid);
@@ -2100,6 +2099,5 @@ PRE(close)
/* int close(int fd); */
MAYBE_PRINTF("close ( %d )\n",arg1);
- /* Detect and negate attempts by the client to close Valgrind's
- logfile fd ... */
+ /* Detect and negate attempts by the client to close Valgrind's log fd */
if (!fd_allowed(arg1, "close", tid))
res = -VKI_EBADF;
--- valgrind/coregrind/docs/coregrind_core.html #1.29:1.30
@@ -163,8 +163,8 @@
commentary to the standard error stream. If you want to send
it to some other file descriptor, for example number 9,
- you can specify <code>--logfile-fd=9</code>.
+ you can specify <code>--log-fd=9</code>.
<p>
<li>A less intrusive option is to write the commentary to a file,
- which you specify by <code>--logfile=filename</code>. Note
+ which you specify by <code>--log-file=filename</code>. Note
carefully that the commentary is <b>not</b> written to the file
you specify, but instead to one called
@@ -177,8 +177,8 @@
<li>The least intrusive option is to send the commentary to a network
socket. The socket is specified as an IP address and port number
- pair, like this: <code>--logsocket=192.168.0.1:12345</code> if you
+ pair, like this: <code>--log-socket=192.168.0.1:12345</code> if you
want to send the output to host IP 192.168.0.1 port 12345 (I have
no idea if 12345 is a port of pre-existing significance). You can
- also omit the port number: <code>--logsocket=192.168.0.1</code>,
+ also omit the port number: <code>--log-socket=192.168.0.1</code>,
in which case a default port of 1500 is used. This default is
defined by the constant <code>VG_CLO_DEFAULT_LOGPORT</code>
@@ -210,5 +210,5 @@
the default (1500). The specified port must be in the range
1024 to 65535. The same restriction applies to port numbers
- specified by a <code>--logsocket=</code> to Valgrind itself.
+ specified by a <code>--log-socket=</code> to Valgrind itself.
</ul>
<p>
@@ -228,5 +228,5 @@
if the tool does profiling, the profile data will be written to a file
of some kind, depending on the tool, and independent of what
-<code>--log*</code> options are in force. The commentary is intended
+<code>--log-*</code> options are in force. The commentary is intended
to be a low-bandwidth, human-readable channel. Profiling data, on the
other hand, is usually voluminous and not meaningful without further
@@ -527,5 +527,5 @@
</li><br><p>
- <li><code>--logfile-fd=<number></code> [default: 2, stderr]
+ <li><code>--log-fd=<number></code> [default: 2, stderr]
<p>Specifies that Valgrind should send all of its
messages to the specified file descriptor. The default, 2, is
@@ -534,5 +534,5 @@
</li><br><p>
- <li><code>--logfile=<filename></code>
+ <li><code>--log-file=<filename></code>
<p>Specifies that Valgrind should send all of its
messages to the specified file. In fact, the file name used
@@ -542,5 +542,5 @@
</li><br><p>
- <li><code>--logsocket=<ip-address:port-number></code>
+ <li><code>--log-socket=<ip-address:port-number></code>
<p>Specifies that Valgrind should send all of its messages to
the specified port at the specified IP address. The port may be
@@ -966,5 +966,5 @@
<li><code>VALGRIND_COUNT_ERRORS</code>: returns the number of errors
found so far by Valgrind. Can be useful in test harness code when
- combined with the <code>--logfile-fd=-1</code> option; this runs
+ combined with the <code>--log-fd=-1</code> option; this runs
Valgrind silently, but the client program can detect when errors
occur. Only useful for tools that report errors, e.g. it's useful for
@@ -1502,5 +1502,5 @@
to close the logfile, because you'd never see any diagnostic
information after that point. If you see this message,
- you may want to use the <code>--logfile-fd=<number></code>
+ you may want to use the <code>--log-fd=<number></code>
option to specify a different logfile file-descriptor number.
Or
--- valgrind/include/vg_skin.h.base #1.20:1.21
@@ -383,6 +383,6 @@
*
* Note that they all output to the file descriptor given by the
- * --logfile-fd=N argument, which defaults to 2 (stderr). Hence no
- * need for VG_(fprintf)().
+ * --log-fd/--log-file/--log-socket argument, which defaults to 2 (stderr).
+ * Hence no need for VG_(fprintf)().
*/
extern UInt VG_(printf) ( const char *format, ... );
--- valgrind/memcheck/tests/error_counts.vgtest #1.1:1.2
@@ -1,2 +1,2 @@
-vgopts: --logfile-fd=-1
+vgopts: --log-fd=-1
prog: error_counts
--- valgrind/none/tests/cmdline1.stdout.exp #1.3:1.4
@@ -25,7 +25,7 @@
user options for Valgrind tools that report errors:
- --logfile-fd=<number> file descriptor for messages [2=stderr]
- --logfile=<file> log messages to <file>.pid<pid>
- --logsocket=ipaddr:port log messages to socket ipaddr:port
+ --log-fd=<number> log messages to file descriptor [2=stderr]
+ --log-file=<file> log messages to <file>.pid<pid>
+ --log-socket=ipaddr:port log messages to socket ipaddr:port
--demangle=no|yes automatically demangle C++ names? [yes]
--num-callers=<number> show <num> callers in stack traces [4]
--- valgrind/none/tests/cmdline2.stdout.exp #1.3:1.4
@@ -25,7 +25,7 @@
user options for Valgrind tools that report errors:
- --logfile-fd=<number> file descriptor for messages [2=stderr]
- --logfile=<file> log messages to <file>.pid<pid>
- --logsocket=ipaddr:port log messages to socket ipaddr:port
+ --log-fd=<number> log messages to file descriptor [2=stderr]
+ --log-file=<file> log messages to <file>.pid<pid>
+ --log-socket=ipaddr:port log messages to socket ipaddr:port
--demangle=no|yes automatically demangle C++ names? [yes]
--num-callers=<number> show <num> callers in stack traces [4]
|