strace

How to parse strace in shell into plain text?

假装没事ソ 提交于 2019-12-17 16:27:48
问题 I've trace log generated by strace command like on running PHP by: sudo strace -e sendto -fp $(pgrep -n php) -o strace.log And the output looks like: 11208 sendto(4, "set 29170397297_-cache-schema 85 0 127240\r\n\257\202\v\0?\0\0\0\2\27\10stdClass\24\7\21\3cid\21\6schema\21\4d\37ata\25\n\247\21\5block\24\6\21\6fields\24\f\21\3bid\24\2\5\21\4type 0\37erial\21\10not null\5\21\6module\24\4\16\7\21\7va\37rchar\21\6length\6@\16\t\5\21\7default\r\21\5de\2lta@ \5\16\v\16\f\6 \35\7\16\r\21\0010\21\5t

Equivalent of strace -feopen < command > on mac os X

[亡魂溺海] 提交于 2019-12-17 08:01:48
问题 This is useful for debugging (hence programming related). On linux, we can use the command strace -feopen python myfile.py to figure out which python modules and shared objects are loaded. Is there an equivalent one-liner on macOS X? 回答1: I suppose you meant strace -fetrace=open ? dtruss -f -t open python myfile.py 来源: https://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x

Equivalent of strace -feopen < command > on mac os X

半腔热情 提交于 2019-12-17 08:01:33
问题 This is useful for debugging (hence programming related). On linux, we can use the command strace -feopen python myfile.py to figure out which python modules and shared objects are loaded. Is there an equivalent one-liner on macOS X? 回答1: I suppose you meant strace -fetrace=open ? dtruss -f -t open python myfile.py 来源: https://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x

Systrace for Windows

元气小坏坏 提交于 2019-12-17 04:43:32
问题 I'm looking for a Windows equivalent of Systrace or at least strace. I'm aware of StraceNT, but wondering if there are any more alternatives out there. Specifically, I'm looking for a specific way to programmatically enforce system call policies, though this can be after the fact rather than actively stopping them. Is there a good way to do this currently? 回答1: WinDbg's Logger.exe is the closest to strace: http://msdn.microsoft.com/en-us/library/windows/hardware/ff552060(v=vs.85).aspx EDIT:

Why STRACE shows EAGAIN (Resource temporarily unavailable)

浪子不回头ぞ 提交于 2019-12-13 12:26:42
问题 Following is the sequence I am getting socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7 setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0 setsockopt(7, SOL_SOCKET, SO_SNDBUF, [32120], 4) = 0 getsockopt(7, SOL_SOCKET, SO_SNDBUF, [30064835312], [4]) = 0 setsockopt(7, SOL_SOCKET, SO_SNDBUF, [64240], 4) = 0 getsockopt(7, SOL_SOCKET, SO_SNDBUF, [30064899552], [4]) = 0 stat("/etc/localtime", {st_dev=makedev(8, 1), st_ino=229001, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st

Profiling for wall-time on Linux

杀马特。学长 韩版系。学妹 提交于 2019-12-12 08:28:52
问题 I have an application that I want to profile wrt how much time is spent in various activities. Since this application is I/O intensive, I want to get a report that will summarize how much time is spent in every library/system call (wall time). I've tried oprofile, but it seems it gives time in terms of Unhalted CPU cycles (thats cputime, not real time) I've tried strace -T, which gives wall time, but the data generated is huge and getting the summary report is difficult (and awk/py scripts

TCP messages getting coalesced

霸气de小男生 提交于 2019-12-11 10:54:12
问题 I have a Java application that is writing to the network. It is writing messages in the region of 764b, +/- 5b. A pcap shows that the stream is getting IP fragmented and we can't explain this. Linux 2.6.18-238.1.1.el5 A strace shows: ( strace -vvvv -f -tt -o strace.out -e trace=network -p $PID ) 1: 2045 12:48:23.984173 sendto(45, "\0\0\0\0\0\0\2\374\0\0\0\0\0\3\n\0\0\0\0\3upd\365myData"..., 764, 0, NULL, 0) = 764 2: 15206 12:48:23.984706 sendto(131, "\0\0\0\0\0\0\2\374\0\0\0\0\0\3\n\0\0\0\0

strace java applet

青春壹個敷衍的年華 提交于 2019-12-11 06:14:22
问题 I'm trying to strace a java applet, and strace doesn't seem to be working. I'm calling the following function. public static void testSTrace(){ long c = 0; for (int i = 0; i < 1000; i++){ long start = System.nanoTime(); try{Thread.sleep(0, 100);}catch(Exception e){/*cry*/} long stop = System.nanoTime(); log.info("start : " +start+" stop : "+stop); } } I get the following output from strace just before the above message is called and then nothing from strace: clone(child_stack=0xb7c9f4c4,

Interpreting STRACE output - pipes and forks

主宰稳场 提交于 2019-12-11 02:40:08
问题 I have the following code written in C, taken from https://beej.us/guide/bgipc/html/multi/pipes.html: #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(void) { int pfds[2]; pipe(pfds); if (!fork()) { close(1); /* close normal stdout */ dup(pfds[1]); /* make stdout same as pfds[1] */ close(pfds[0]); /* we don't need this */ execlp("/bin/ls", "ls", NULL); } else { close(0); /* close normal stdin */ dup(pfds[0]); /* make stdin same as pfds[0] */ close(pfds[1]); /* we don't need

strace fixes hung process

被刻印的时光 ゝ 提交于 2019-12-10 17:15:33
问题 I have a single threaded unix process that communicates over tcp with other processes. The problem is the following. When I start up the process it hangs (no busy loop) until I kill it. The funny thing is, as soon as I attach with strace to it, it continues to run with the expected behavior as if there was no problem at all. (always reproducible) What could be the reason for this behavior? What effect has strace on the state ob a process? Update: The cause of strace changing the behavior was,