The UNIX and Linux Forums  

Go Back   UNIX e Linux Forum > Inizio Forum > Di programmazione ad alto livello
.
google unix.com



Di programmazione ad alto livello Pubblica domande su C, C + +, Java, SQL, e di altri linguaggi di programmazione qui.

Più di UNIX e Linux Forum Argomenti potreste trovare utili
Filo Thread Starter Forum Risposte Ultimo Post
semaforo raguramtgr UNIX for Dummies Domande & Risposte 7 06-15-2009 10:39 AM
Semaphore Jaken Shell scripting e di programmazione 2 04-04-2009 06:10 PM
dmidecode, velocità di RAM \u003d "Velocità attuale: Sconosciuto" Santi Filesystem, memoria e dischi 0 02-16-2006 06:16 AM
Semaphore vjsony UNIX for Dummies Domande & Risposte 3 04-07-2003 03:06 PM
semaforo yls177 UNIX for Dummies Domande & Risposte 1 10-09-2002 12:18 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Cerca in questo Thread Rating: Thread Rating: 1 votes, 4.00 average. Modalità di visualizzazione
  #1 (permalink)  
Old 09-20-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderatore ala Mode
  
 

Iscriviti Data: febbraio 2007
Località: Innsbruck, Austria
Messaggi: 1.893
Citazione:
Originalmente inviato da migurus View Post
Jim,
Non ho mai provato prima di profilazione, così mi sono imbattuto in qualche problema qui:
$ Gcc-pg-o tstloop tstloop.c
$ Tstloop
128.205,13 semop / s [0,0]
$ Gprof tstloop
gprof: gmon.out file è mancante call-grafico dei dati
Questo è strano. Qualsiasi possibilità si sta eseguendo un programma diverso che in altre parti del percorso? Provate ad esempio l'esecuzione di ". / Tstloop".

Inoltre, per gprof, utilizzare l'opzione-l (L piccola). Ottenere:


Codice:
$ gprof -l  ./semget
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
 57.10      0.13     0.13                             main (semget.c:21 @ 80485f0)
 25.12      0.18     0.06                             main (semget.c:18 @ 804861f)
  9.14      0.20     0.02                             main (semget.c:17 @ 8048614)
  6.85      0.22     0.02                             main (semget.c:16 @ 80485e4)

Linea 21 è il semctl () funzione. Linea 18 è il semget () chiamata.

Ora che abbiamo risultati concreti, I'd cross-post su questo sito Linuxquestions.org com.

Il passo successivo sarebbe quello di utilizzare il debug / profilazione versione di libc (che non ho il galleggiante circa) e vedere se possiamo usare gprof per trovare in esso il collo di bottiglia. Oppure, guardare la fonte. Sembra di essere di grande vantaggio di avere questa migliorata.
  #2 (permalink)  
Old 09-20-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderatore ala Mode
  
 

Iscriviti Data: febbraio 2007
Località: Innsbruck, Austria
Messaggi: 1.893
Usa / usr / bin / time-v per maggiori informazioni

Possiamo escludere marginalmente pagina colpe e simili guardando l'output di / usr / bin / time-v. Il minore errore di pagina si intende il sistema operativo riservata una pagina di memoria interna e che le tabelle sono state modificate, ma il processo non è stata sospesa a causa di IO o qualcosa di simile. Risulta, tutti questi sono dovuti ad una profilazione del codice o il programma invocazione.


Codice:
$ /usr/bin/time -vv  ./semget
555555.56 semop/s [0,0]
Command exited with non-zero status 24
        Command being timed: "./semget"
        User time (seconds): 2.85
        System time (seconds): 6.12
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.99
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 135
        Voluntary context switches: 7
        Involuntary context switches: 53
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 24

  #3 (permalink)  
Old 09-22-2008
migurus migurus is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posizione: Stati Uniti
Interventi: 49
Citazione:
Originalmente inviato da otheus View Post
Questo è strano. Qualsiasi possibilità si sta eseguendo un programma diverso che in altre parti del percorso? Provate ad esempio l'esecuzione di ". / Tstloop".

Inoltre, per gprof, utilizzare l'opzione-l (L piccola). Ottenere:

.
a Jim:

tstloop è l'unico programma, ho fatto eseguire nuovamente
$. / Tstloop
$ Gprof-l. / Tstloop
gprof: gmon.out file è mancante call-grafico dei dati

Grazie per l'assunzione di altri forum.

a Otheus:

tstloop compilato con il profiling:

Codice:
 
$ /usr/bin/time -vv ./tstloop
125000.00 semop/s [0,0]
Command exited with non-zero status 24
        Command being timed: "tstloop"
        User time (seconds): 15.05
        System time (seconds): 24.33
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:39.39
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 121
        Voluntary context switches: 1
        Involuntary context switches: 326
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 24

e qui sono i risultati di programma compilato senza profilazione


Codice:
 
$ /usr/bin/time -vv ./tstloop
128205.13 semop/s [0,0]
Command exited with non-zero status 24
        Command being timed: "./tstloop"
        User time (seconds): 15.39
        System time (seconds): 23.19
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:38.59
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 101
        Voluntary context switches: 1
        Involuntary context switches: 112
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 24

  #4 (permalink)  
Old 09-20-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderatore ala Mode
  
 

Iscriviti Data: febbraio 2007
Località: Innsbruck, Austria
Messaggi: 1.893
------

Ultimo a cura di otheus; al 09/20/2008 08:52 AM.. Motivo: Non visualizzare ulteriori risposte.
  #5 (permalink)  
Old 09-22-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderatore ala Mode
  
 

Iscriviti Data: febbraio 2007
Località: Innsbruck, Austria
Messaggi: 1.893
Provate a lanciare gprof con e-p-l. La mia nuova versione potrebbe non necessità l'opzione-p.
  #6 (permalink)  
Old 09-22-2008
migurus migurus is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posizione: Stati Uniti
Interventi: 49
-p bandiera aiutato, si prega di vedere i risultati al di sotto

$ Gprof-p. / Tstloop
Profilo piatto:

Ogni campione come conta 0,01 secondi.
% Cumulativa totale auto auto
secondo tempo secondo le chiamate T / T chiamata / chiamata nome
99,70 3,64 3,64 principale
  #7 (permalink)  
Old 09-23-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderatore ala Mode
  
 

Iscriviti Data: febbraio 2007
Località: Innsbruck, Austria
Messaggi: 1.893
E-l bandiera.
Closed Thread

Segnalibri

Thread Tools Cerca in questo Thread
Cerca in questo Thread:

Ricerca Avanzata
Modalità di visualizzazione Vota questo thread
Vota questo thread:

Distacco regolamento
Tu non può post nuovo thread
Tu non può inviare una risposta
Tu non può postare allegati
Tu non può modificare i tuoi post

BB codice è Su
Smilies sono Su
[IMG] codice Su
Codice HTML è Chiuso
Trackbacks sono Su
Pingbacks sono Su
Refbacks sono Su




Tutti gli orari sono GMT -4. La data di oggi è 08:43 PM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traduzioni Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX e Linux Forum Content Copyright © 1993-2009. Tutti i diritti Reserved.Ad di gestione da RedTyger

Contenuti pertinenti URL da vBSEO 3.2.0