[sheepdog] [PATCH v2 00/10] refine tracer

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Aug 9 05:21:54 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

v2:
 - fix a wrong calculation of the number of suspended threads
 - move sheep/thread-check.c to sheep/tracer/checker.c
 - add static to NOP5
 - remove --enable-thread-check
 - suspend worker threads only when it is really needed
 - rename 'collie debug trace' to 'collie trace' and udpate the
   subcommands


The current tracer has the following problems:

 - We cannot use the tracer with debug build.
 - GDB doesn't print a line number if we link tracer.ld.
 - We cannot trace the function which were not called before starting
   tracer.
 - There are some race conditions.

This series fixes these problem.

This series is a bit big, but helps us lot to debug codes and find a
bottleneck.  In addition, it doesn't hurt the sheep core codes at all.
I'd like to include this series in the 0.7.0 release if possible.

MORITA Kazutaka (10):
  move suspend_worker_threads and resume_worker_threads to work.c
  trace: create a caller list in tracer_init()
  trace: guard strbuf with pthread_mutex_lock
  trace: add support for stackable tracers
  trace: move nop5 to trace.c
  add notrace to only entry point and exit point
  configure: support tracer with debug build
  sheep: add a checker for thread type
  sheep: add event_loop checker
  collie: rename debug to trace

 collie/Makefile.am          |    4 +-
 collie/collie.c             |    4 +-
 collie/collie.h             |    4 +-
 collie/common.c             |    5 +-
 collie/{debug.c => trace.c} |  109 ++++++----
 configure.ac                |   21 +-
 include/bitops.h            |   31 +++
 include/internal_proto.h    |    4 +-
 include/list.h              |    1 -
 include/sheep.h             |    1 +
 include/util.h              |    2 +-
 include/work.h              |    5 +-
 lib/logger.c                |   40 ++--
 lib/net.c                   |    4 +-
 lib/strbuf.c                |    4 +-
 lib/util.c                  |    9 +-
 lib/work.c                  |  103 ++++++++--
 sheep/Makefile.am           |    2 +-
 sheep/group.c               |   31 +--
 sheep/ops.c                 |   42 +++-
 sheep/request.c             |   11 +-
 sheep/sheep.c               |    7 +-
 sheep/sheep_priv.h          |   19 ++
 sheep/trace/checker.c       |   77 ++++++++
 sheep/trace/graph.c         |  102 +++-------
 sheep/trace/mcount.S        |   39 +---
 sheep/trace/stabs.c         |  210 --------------------
 sheep/trace/trace.c         |  459 +++++++++++++++++++++++++------------------
 sheep/trace/trace.h         |   67 +++----
 sheep/trace/trace.ld        |   18 --
 30 files changed, 733 insertions(+), 702 deletions(-)
 rename collie/{debug.c => trace.c} (63%)
 create mode 100644 sheep/trace/checker.c
 delete mode 100644 sheep/trace/stabs.c
 delete mode 100644 sheep/trace/trace.ld

-- 
1.7.9.5




More information about the sheepdog mailing list