2009-07-27 6 views
1

Je suis en train d'essayer une applet Java, et strace ne semble pas fonctionner. J'appelle la fonction suivante.strace java applet

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); 
    } 
} 

je reçois la sortie suivante de strace juste avant le message ci-dessus est appelé et rien de strace:

clone(child_stack=0xb7c9f4c4, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM| 
CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, 
parent_tidptr=0xb7c9fbf8, {entry_number:6, base_addr:0xb7c9fbb0, 
limit:1048575, seg_32bit:1, 
contents:0, read_exec_only:0, 
limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7c9fbf8) = 8351 futex(0xb7c9fbf8, FUTEX_WAIT, 8351, NULL 

Une fois que je commence à obtenir la sortie du journal de la méthode, je reçois plus rien de strace . Je suis assez nouveau pour le strace. Des indices sur ce qui se passe? Les applets peuvent-elles être striées?

Répondre

1

Vous êtes probablement strace'ing un seul fil. courir avec le drapeau -f.

+1

oui, je l'ai compris 30 secondes après avoir posté mes questions =) –

0

Trois hourras pour les pages de l'homme, je veux le drapeau des fourches de suivi, -f et -F

-f -- follow forks, -ff -- with output into separate files 
-F -- attempt to follow vforks, -h -- print help message 

strace -fF /bin/appletviewer test.html 

maintenant je reçois:

[pid 8401] gettimeofday({1248700317, 550296}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 550401}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 550500}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 550626}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 550883}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 550993}, NULL) = 0 
[pid 8401] gettimeofday({1248700317, 551093}, NULL) = 0