Sponsored Content
Full Discussion: Debug mode
Top Forums Shell Programming and Scripting Debug mode Post 302322293 by pludi on Wednesday 3rd of June 2009 09:24:06 AM
Old 06-03-2009
That's because tracing output is written to stderr, not stdout. Try
Code:
ksh -x script.sh 2> trace.log

 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

“Ostream” object is not printing message on HP-UNIX for debug mode

The following C++ code segment is not working in debug mode build on HP-UNIX machine. It is not printing "Hello World" message on the screen. While it is working fine in release mode build. ============================================== class KLogStreamBuf : public streambuf { public:... (0 Replies)
Discussion started by: heena
0 Replies

2. Shell Programming and Scripting

run in debug mode

Hi, I have a question on my korn shell script. When I run without debugging turned on, I can't get the correct result. If I turn on the debug mode, like sh -x myprogram, it will give me the correct result. Can someone tell me what is going on here? Thanks, :rolleyes: (6 Replies)
Discussion started by: whatisthis
6 Replies

3. AIX

Running Installp in debug mode

Is there a way I can execute an installp command in debug mode, so that I can see whats happening when a fileset is being installed or updated? (What files are being replace etc etc). I have an installp command failing for unknown reason. (7 Replies)
Discussion started by: balaji_prk
7 Replies

4. Red Hat

ehternet in debug mode

I have a little dell running redhat server. it's getting ethernet traffic to console and /var/log/messages (up 60Mb) i can't seem to find where to turn it off! any help would be greatly appreciated. here's syslog: here's a snip from the log: Sep 28 21:34:08 zgarch_serv kernel: IN=eth0... (2 Replies)
Discussion started by: toferloafer
2 Replies

5. Programming

Compile a proc/c++ file in debug mode.

Hi, I'm using the following commands to execute a proc file, but I'm unable to debug the program. What modifications do I need to make in the command options to debug the program created. I have a proc1.pc file, using the following three steps to generate the proc1 exe. After the proc1 exe... (2 Replies)
Discussion started by: ehari
2 Replies

6. Shell Programming and Scripting

perl: a way to see a sub code in debug mode: perl -de 0 ?

Is there a way to see or print a sub code? Sometime a sub could be already defined, but in the debug mode (so, interactively) it could be already out of screen. So, I would think about a way to check if the sub is defined (just 'defined' is not a problem) and how it is defined. Also, if... (4 Replies)
Discussion started by: alex_5161
4 Replies

7. Programming

Is there any possibility of running the PHP script in a debug mode ?

Is there any possibility of running the PHP script in a debug mode ? If so, do i have to download any package? Any free downloads available? Can anyone please guide me through? Am a newbie in PHP scripting. Thanks in Advance! (1 Reply)
Discussion started by: vidhyaS
1 Replies

8. Shell Programming and Scripting

Logging perl and shell debug mode.

I have a shell program which calls a perl program. I am running the shell program with command; $ ksh -x <prog_name> Inside the shell program, I am calling perl with warnings. I want to capture the entire output as it comes on screen. The command I tried is: $ ksh -x... (1 Reply)
Discussion started by: som.nitk
1 Replies
KTRACE(1)						    BSD General Commands Manual 						 KTRACE(1)

NAME
ktrace, ktruss -- enable kernel process tracing SYNOPSIS
ktrace [-aCcdins] [-f trfile] [-g pgrp] [-p pid] [-t trstr] ktrace [-adis] [-f trfile] [-t trstr] command ktruss [-aCcdilnRT] [-e emulation] [-f infile] [-g pgrp] [-m maxdata] [-o outfile] [-p pid] [-t trstr] ktruss [-adinRT] [-e emulation] [-m maxdata] [-o outfile] [-t trstr] [-v vers] command DESCRIPTION
ktrace enables kernel trace logging for the specified processes. Kernel trace data is logged to the file ktrace.out. The kernel operations that are traced include system calls, namei translations, signal processing, and I/O. Once tracing is enabled on a process, trace data will be logged until either the process exits or the trace point is cleared. A traced process can generate enormous amounts of log data quickly; It is strongly suggested that users memorize how to disable tracing before attempting to trace a process. The following command is sufficient to disable tracing on all user owned processes, and, if executed by root, all processes: $ ktrace -C The trace file is not human readable; use kdump(1) to decode it. ktruss is functionally the same as ktrace except that trace output is printed on standard output or to the file specified with the -o option. ktruss is useful to see the kernel operations interleaved with the program output. The options are as follows: -a Append to the trace file instead of truncating it. -C Disable tracing on all user owned processes, and, if executed by root, all processes in the system. -c Clear the trace points associated with the specified file or processes. -d Descendants; perform the operation for all current children of the designated processes. -f trfile Log trace records to trfile instead of ktrace.out. -f infile Read the trace records from infile and print them in a human readable format to standard out. -g pgid Enable (disable) tracing on all processes in the process group (only one -g flag is permitted). -i Inherit; pass the trace flags to all future children of the designated processes. -l Poll the trace file for new data and print it to standard out. Only for use together with the -f option. -m maxdata Print at most maxdata bytes of data. This is used for pointer type arguments, e.g., strings. The data will be escaped in C-style unless -x is specified when it will be output in hex and ascii. -n Stop tracing if attempts to write to the trace file would block. This option always affects ktruss and only affects ktrace when writing to stdout. If this flag is not set, then the traced program will block until it can write more data to the trace file descriptor. -o outfile Log trace records to outfile. Without this option ktruss will print its output in a human readable format to standard out. -p pid Enable (disable) tracing on the indicated process id (only one -p flag is permitted). -s Write to the trace file with synchronized I/O. -R Display relative time stamps to output. -T Same as the -R option, but use absolute timestamps instead. -t trstr The string argument represents the kernel trace points, one per letter. The following table equates the letters with the trace- points: A trace all tracepoints a trace exec arguments c trace system calls e trace emulation changes f trace open file descriptors after exec i trace I/O n trace namei translations S trace MIB access (sysctl) s trace signal processing u trace user data v trace exec environment w trace context switches + trace the default set of trace points (c, e, i, l, m, n, s, u) - do not trace following trace points -e emulation If an emulation of a process is unknown, interpret system call maps assuming the named emulation instead of default "netbsd". command Execute command with the specified trace flags. -v version Determines the version of the file generated. Version 0 is the compatible ktrace format, and version 1 is the new format with lwp IDs and nanosecond (instead of microsecond) timestamps. The -p, -g, and command options are mutually exclusive. The -R and -T options are also mutually exclusive. EXAMPLES
# trace all kernel operations of process id 34 $ ktrace -p 34 # trace all kernel operations of processes in process group 15 and # pass the trace flags to all current and future children $ ktrace -idg 15 # disable all tracing of process 65 $ ktrace -cp 65 # disable tracing signals on process 70 and all current children $ ktrace -t s -cdp 70 # enable tracing of I/O on process 67 $ ktrace -ti -p 67 # run the command "w", tracing only system calls $ ktrace -tc w # disable all tracing to the file "tracedata" $ ktrace -c -f tracedata # disable tracing of all processes owned by the user $ ktrace -C # run the command "w", displaying to standard output $ ktruss w # trace process 42 and log the records to "ktruss.out" $ ktruss -p 42 -o ktruss.out # poll ktruss.out for available records and print them $ ktruss -lf ktruss.out SEE ALSO
kdump(1), ktrace(2) HISTORY
The ktrace command appears in 4.4BSD. BSD
June 1, 2011 BSD
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy