Andreas,

        I doubt that the jump table is being caused by calling through a  
function pointer.

        Usually I see them generated in response to switch statements or long  
if-else-if
chains. However, the compiler is free to do whatever optimizations it  
can. I'm speculating
that the compiler found some interesting patterns in your code, which  
has a number of
if statments and ternary operators.

        However, not being a real compiler expert, I can't say for certain.  
You could tweak
the code and probably make the jump table go away. Any fix you made  
would be somewhat
fragile, though.

        James M

On Nov 27, 2007, at 8:52 AM, [EMAIL PROTECTED] wrote:

> I resend this as Chris and I got no answer so far.
>
> The issue is a pid provider probe gets rejected by Apple dtrace.
> Suspicion it is rejected due to
>
>  libdtrace DEBUG: found a suspected jump table at
>
> below is a snippet of the assembly code of that function, that looks  
> like a jump table plus the C preprocessor output of the
> same function.
>
> Anyone having an idea what could cause this jump table?
>
> Regards,
> Andreas
>
> ---------- Forwarded message ----------
> Date: Wed, 14 Nov 2007 19:52:51 +0100 (MET)
> From: [EMAIL PROTECTED]
> To: [email protected]
> Cc: Chris Dagdigian <[EMAIL PROTECTED]>, James McIlree <[EMAIL PROTECTED] 
> >
> Subject: Re: [dtrace-discuss] [GE users] Apple Leopard has dtrace --  
> anyone used
>     the SGE probes/scripts yet?
>
> Hm ... the assebly of the function contains code like this
>
>   movl  L279-"L00000000011$pb"(%ebx,%eax,4), %eax
>   addl  %ebx, %eax
>   jmp   *%eax
>   .align 2,0x90
> L279:
>   .long L187-"L00000000011$pb"
>   .long L188-"L00000000011$pb"
>   .long L189-"L00000000011$pb"
>     :
>    (much more of this kind)
>     :
>
> if that is meant by
>
>   libdtrace DEBUG: found a suspected jump table at  
> sge_mirror_process_events:323
>
> that could be the cause, but I got no idea where it comes from.  
> Preprocessor output
> of the code is this
>
> sge_mirror_error __attribute__((noinline))  
> sge_mirror_process_events(sge_evc_class_t *evc)
> {
>   lList *event_list = ((void *)0);
>   sge_mirror_error ret = SGE_EM_OK;
>   static int test_debug = 0;
>
>
>   static const char SGE_FUNC[] = "sge_mirror_process_events"; static  
> const int xaybzc = 0; if (rmon_condition(xaybzc, 1)) rmon_menter  
> (SGE_FUNC);
>
>   if(prof_is_active(SGE_PROF_MIRROR))  
> { prof_start_measurement(SGE_PROF_MIRROR,((void *)0)); };
>
>   mir_set_num_events(0);
>
>   if (evc && evc->ec_get(evc, &event_list, false)) {
>      if (event_list != ((void *)0)) {
>         ret = sge_mirror_process_event_list(evc, event_list);
>         lFreeList(&event_list);
>      }
>   } else {
>      ( sprintf (log_get_log_buffer(), (("qmaster alive timeout  
> expired"))), sge_log(4,log_get_log_buffer(),"../libs/mir/ 
> sge_mirror.c",SGE_FUNC,1141) ,1) ?
> 1 : 0;
>      evc->ec_mark4registration(evc);
>      ret = SGE_EM_TIMEOUT;
>   }
>
>   if (mir_get_produce_qmaster_alive_timeout()) {
>      test_debug++;
>      if (test_debug > 3) {
>         test_debug = 0;
>         ( sprintf (log_get_log_buffer(), (("qmaster alive timeout  
> expired"))), sge_log(4,log_get_log_buffer(),"../libs/mir/ 
> sge_mirror.c",SGE_FUNC,1150) ,1)
> ? 1 : 0;
>         evc->ec_mark4registration(evc);
>         ret = SGE_EM_TIMEOUT;
>      }
>   }
>
>   if (prof_is_active(SGE_PROF_MIRROR)) {
>      prof_stop_measurement(SGE_PROF_MIRROR, ((void *)0));
>      (sprintf (log_get_log_buffer(), "PROF: sge_mirror processed %d  
> events in %.3f s", mir_get_num_events(),
> prof_get_measurement_wallclock(SGE_PROF_MIRROR, false, ((void  
> *)0))), sge_log(0, log_get_log_buffer(),"../li
> bs/mir/sge_mirror.c",SGE_FUNC,1160) ,1) ? 1 : 0;
>
>
>   }
>
>   if (rmon_condition(xaybzc, 1)) rmon_mexit(SGE_FUNC, "../libs/mir/ 
> sge_mirror.c", 1163);
>   return ret;
> }
>
> Could it be the jump table is generated due to the function calls  
> via function pointer are done by sge_mirror_process_events()?
>
> Regards,
> Andreas

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to