Branch: Tag:

2010-03-24

2010-03-24 20:47:54 by Martin Stjernholm <mast@lysator.liu.se>

Log thread yield points in the opcode trace (level 3).

Rev: src/interpret.h:1.181

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.h,v 1.180 2009/04/01 20:26:37 mast Exp $ + || $Id: interpret.h,v 1.181 2010/03/24 20:47:54 mast Exp $   */      #ifndef INTERPRET_H
687:   PMOD_EXPORT extern unsigned long evaluator_callback_calls;   #endif    - #define check_threads_etc() do { \ + #define low_check_threads_etc() do { \    DO_IF_INTERNAL_PROFILING (evaluator_callback_calls++); \    call_callback(& evaluator_callbacks, NULL); \   }while(0)    -  + #define check_threads_etc() do { \ +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \ +  low_check_threads_etc(); \ +  } while (0) +    extern int fast_check_threads_counter;      #define fast_check_threads_etc(X) do { \ -  +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \    if (++fast_check_threads_counter >= (1 << (X))) { \    fast_check_threads_counter = 0; \ -  check_threads_etc(); \ +  low_check_threads_etc(); \    } \    } while(0)   
707:    * it can vary greatly - from 0 to 30000+ calls/sec. In a test case    * with about 22000 calls/sec, it took 0.042% of the cpu. */   #define FAST_CHECK_THREADS_ON_CALL() do { \ +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \    if (++fast_check_threads_counter >= (1 << 6)) { \    fast_check_threads_counter = 0; \ -  check_threads_etc(); \ +  low_check_threads_etc(); \    } \    else if (objects_to_destruct) \    /* De facto pike semantics requires that freed objects are */ \