Opened 12 years ago

Closed 12 years ago

#1481 closed Bug (invalid)

Use a lot of CPU, because of call on gettimeofday() often?

Reported by: mezz Owned by:
Priority: Normal Milestone: None Set
Component: Transmission Version: 1.40
Severity: Normal Keywords:
Cc:

Description

Transmission call on gettimeofday() too often. I am not sure if it's normal, but it's what it causing use CPU a lot. In the ktrace shows:

 77104 transmission RET   read 16384/0x4000
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fed38,0)
 77104 transmission RET   gettimeofday 0
 77104 transmission CALL  gettimeofday(0xbf9fec38,0)
 77104 transmission RET   gettimeofday 0
[...goes on for thousands lines...]

I have found the gettimeofday() is in libtransmission/utils.c in tr_date() and tr_getLogTimeStr() functions. Also, it's in libnatpmp and libevent. I am not sure which one is supposed to take a blame. I have google a bit by enter 'gettimeofday cpu' and there is many of it, so I am not sure which one might help.

I don't know if tr_date() or tr_getLogTimeStr() is being call on too often if gettimeofday() is correct. I can try valgrind if you still want me to.

Oh yeah, forgot to say about that I have 1.40+ (7126) here.

Change History (2)

comment:1 Changed 12 years ago by charles

mezz: what data do you have that shows that gettimeofday() is using a large percentage of CPU time? I'm not seeing that at all.

comment:2 Changed 12 years ago by mezz

  • Resolution set to invalid
  • Status changed from new to closed

I am not able to run valgrind, which it keeps crash. I am going to close this until I learn how to get good info from use a lot CPU. It only happens on 53gb torrent and I almost never download more than 350mb torrent, so not really a big problem for me.

Note: See TracTickets for help on using tickets.