GitHub PushEvent at 2014-07-02 06:43:47
Repository: osv
Actor: penberg
Payload: {"shas":[["de0fc5ea31b732aeba4b2afe95ebb2aef6d72d7f","625169824b719df98706d88646d0aae6f368ae4d@cloudius-systems.com","Add names to threads running external executables\n\nFor gdb's \"osv info threads\" and the new top.py, it is useful for all\nthreads to have names. Most of OSv's internal threads already have\ninformational names, but when we run external executables like java\nor memcached, we often see empty names.\n\nThis patch changes loader.cc's \"run_main\", during its run of an\nexecutable's main(), to set the current thread's name to the executable's\nname. Moreover, if a thread spawns another thread and doesn't explicitly\nset its name, it will inherit the parent's name, with a prepended \">\"\ncharacter.\n\nFor example, \"top\" while running both memcached and Java (the shell),\nmight now show this:\n\n157 threads on 4 CPUs; idle:  69%  27%  86%  89%\n   ID  %CPU    TIME NAME\n  216  90.4   27.28 >/memcached\n   41  19.6    5.01 virtio-net-rx\n  234   6.1    1.61 >>>java.so\n    2   3.4    5.60 page-access-sca\n  227   2.5    0.69 >java.so\n  228   1.8    0.61 >java.so\n  ....\n\nNote how the thread using 90.4% of a CPU is named \">/memcached\", meaning\nit is a thread spawned by /memcached's main() thread. Another 6.1% is\nspend by \">>>java.so\", which is the great-grandson of the java.so main\nthread; We don't know what is the function of this thread (it would be\nnice to be able to somehow figure this out), but at least knowing it is\npart of Java, and not a part of memcached or libhttpserver or some\nanonymous part of the kernel, is interesting.\n\nSigned-off-by: Nadav Har'El <nyh@cloudius-systems.com>\nSigned-off-by: Pekka Enberg <penberg@cloudius-systems.com>","Nadav Har'El",true]],"size":1,"ref":"refs/heads/master","head":"de0fc5ea31b732aeba4b2afe95ebb2aef6d72d7f"}