[Pcsclite-git-commit] [PCSC] 01/01: pcsc-spy: log the thread number in the results

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu Nov 24 17:54:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit b703805510b814b78967c7e84ad3a477cb8fc10e
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Thu Nov 24 16:43:25 2016 +0100

    pcsc-spy: log the thread number in the results
    
    The "Results sorted by total execution time" are displayed for each
    thread found. Now the thread index is also displayed to make it more
    explicit why different results are displayed.
    
    We now have something like:
    Thread 1/3
    Results sorted by total execution time
    total time: 0.002176 sec
    0.000554 sec (  2 calls) 25.46% SCardListReaders
    0.000529 sec (  3 calls) 24.31% SCardConnect
    0.000251 sec (  1 calls) 11.53% SCardEstablishContext
    0.000196 sec (  3 calls)  9.01% SCardDisconnect
    0.000081 sec (  1 calls)  3.72% SCardReleaseContext
    
    Thread 2/3
    Results sorted by total execution time
    total time: 0.002176 sec
    0.000720 sec (  3 calls) 33.09% SCardConnect
    0.000390 sec (  2 calls) 17.92% SCardListReaders
    0.000250 sec (  3 calls) 11.49% SCardDisconnect
    0.000177 sec (  1 calls)  8.13% SCardEstablishContext
    0.000065 sec (  1 calls)  2.99% SCardReleaseContext
    
    Thread 3/3
    Results sorted by total execution time
    total time: 0.002176 sec
    0.000499 sec (  3 calls) 22.93% SCardConnect
    0.000456 sec (  1 calls) 20.96% SCardEstablishContext
    0.000347 sec (  2 calls) 15.95% SCardListReaders
    0.000275 sec (  3 calls) 12.64% SCardDisconnect
    0.000050 sec (  1 calls)  2.30% SCardReleaseContext
    
    Thanks to Oliver Graute for the "bug" request
    "[Pcsclite-muscle] High CPU load with pcscd and Kerkey security Module"
    http://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20161121/000766.html
---
 src/spy/pcsc-spy | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/spy/pcsc-spy b/src/spy/pcsc-spy
index a44e0cb..faa0716 100755
--- a/src/spy/pcsc-spy
+++ b/src/spy/pcsc-spy
@@ -880,6 +880,7 @@ class PCSCdemultiplexer(object):
         total_time = end_time - start_time
 
         # compute some statistics
+        thread_n = 1
         for thread in stats:
             stat = stats[thread]
             for fct in stat:
@@ -891,6 +892,7 @@ class PCSCdemultiplexer(object):
 
             # display statistics sorted by total_time
             print
+            print "Thread %d/%d" % (thread_n, len(stats))
             print "Results sorted by total execution time"
             print "total time: %f sec" % total_time
             for record in sorted(records, key=attrgetter('total_time'),
@@ -899,6 +901,8 @@ class PCSCdemultiplexer(object):
                     record.occurences, record.total_time / total_time * 100.,
                     record.name)
 
+            thread_n += 1
+
 
 def main(logfile=None, color=True, diffable=False):
     """ main """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list