src/lib/jcr.c
void dbg_print_jcr(FILE *fp)
{
   char buf1[128], buf2[128], buf3[128], buf4[128];

   if (!jcrs) {
      return;
   }

   fprintf(fp, "Attempt to dump current JCRs. njcrs=%d\n", jcrs->size());

   for (JCR *jcr = (JCR *)jcrs->first(); jcr ; jcr = (JCR *)jcrs->next(jcr)) {
      fprintf(fp, "threadid=%p JobId=%d JobStatus=%c jcr=%p name=%s\n",
              get_threadid(jcr->my_thread_id), (int)jcr->JobId, jcr->JobStatus, jcr, jcr->Job);
      fprintf(fp, "\tuse_count=%i killable=%d\n",
              jcr->use_count(), jcr->is_killable());
      fprintf(fp, "\tJobType=%c JobLevel=%c\n",
              jcr->getJobType(), jcr->getJobLevel());
      bstrftime(buf1, sizeof(buf1), jcr->sched_time);
      bstrftime(buf2, sizeof(buf2), jcr->start_time);
      bstrftime(buf3, sizeof(buf3), jcr->end_time);
      bstrftime(buf4, sizeof(buf4), jcr->wait_time);
      fprintf(fp, "\tsched_time=%s start_time=%s\n\tend_time=%s wait_time=%s\n",
              buf1, buf2, buf3, buf4);
      fprintf(fp, "\tdb=%p db_batch=%p batch_started=%i\n",
              jcr->db, jcr->db_batch, jcr->batch_started);

      /*
       * Call all the jcr debug hooks
       */
      for(int i=0; i < dbg_jcr_handler_count; i++) {
         dbg_jcr_hook_t *hook = dbg_jcr_hooks[i];
         hook(jcr, fp);
      }
   }
}
/*
 * !!! WARNING !!!
 *
 * This function should be used ONLY after a fatal signal. We walk through the
 * JCR chain without doing any lock, Bacula should not be running.
 */
WARNING
This function should be used ONLY after a fatal signal. We walk through the
JCR chain without doing any lock, Bacula should not be running.
WARNING This function should be used ONLY after a fatal signal . We walk through the JCR chain without doing any lock Bacula should not be running .
void dbg_print_jcr(FILE *fp)
{
   char buf1[128], buf2[128], buf3[128], buf4[128];
   if (!jcrs) {
      return;
   }
   fprintf(fp, "Attempt to dump current JCRs. njcrs=%d\n", jcrs->size());
   for (JCR *jcr = (JCR *)jcrs->first(); jcr ; jcr = (JCR *)jcrs->next(jcr)) {
      fprintf(fp, "threadid=%p JobId=%d JobStatus=%c jcr=%p name=%s\n",
              get_threadid(jcr->my_thread_id), (int)jcr->JobId, jcr->JobStatus, jcr, jcr->Job);
      fprintf(fp, "\tuse_count=%i killable=%d\n",
              jcr->use_count(), jcr->is_killable());
      fprintf(fp, "\tJobType=%c JobLevel=%c\n",
              jcr->getJobType(), jcr->getJobLevel());
      bstrftime(buf1, sizeof(buf1), jcr->sched_time);
      bstrftime(buf2, sizeof(buf2), jcr->start_time);
      bstrftime(buf3, sizeof(buf3), jcr->end_time);
      bstrftime(buf4, sizeof(buf4), jcr->wait_time);
      fprintf(fp, "\tsched_time=%s start_time=%s\n\tend_time=%s wait_time=%s\n",
              buf1, buf2, buf3, buf4);
      fprintf(fp, "\tdb=%p db_batch=%p batch_started=%i\n",
              jcr->db, jcr->db_batch, jcr->batch_started);
      for(int i=0; i < dbg_jcr_handler_count; i++) {
         dbg_jcr_hook_t *hook = dbg_jcr_hooks[i];
         hook(jcr, fp);
      }
   }
}
void dbg_print_jcr ( FILE * fp ) { char buf1 [ 128 ] , buf2 [ 128 ] , buf3 [ 128 ] , buf4 [ 128 ] ; if ( ! jcrs ) { return ; } fprintf ( fp , " \n " , jcrs -> size ( ) ) ; for ( JCR * jcr = ( JCR * ) jcrs -> first ( ) ; jcr ; jcr = ( JCR * ) jcrs -> next ( jcr ) ) { fprintf ( fp , " \n " , get_threadid ( jcr -> my_thread_id ) , ( int ) jcr -> JobId , jcr -> JobStatus , jcr , jcr -> Job ) ; fprintf ( fp , " \t \n " , jcr -> use_count ( ) , jcr -> is_killable ( ) ) ; fprintf ( fp , " \t \n " , jcr -> getJobType ( ) , jcr -> getJobLevel ( ) ) ; bstrftime ( buf1 , sizeof ( buf1 ) , jcr -> sched_time ) ; bstrftime ( buf2 , sizeof ( buf2 ) , jcr -> start_time ) ; bstrftime ( buf3 , sizeof ( buf3 ) , jcr -> end_time ) ; bstrftime ( buf4 , sizeof ( buf4 ) , jcr -> wait_time ) ; fprintf ( fp , " \t \n \t \n " , buf1 , buf2 , buf3 , buf4 ) ; fprintf ( fp , " \t \n " , jcr -> db , jcr -> db_batch , jcr -> batch_started ) ; for ( int i = 0 ; i < dbg_jcr_handler_count ; i ++ ) { dbg_jcr_hook_t * hook = dbg_jcr_hooks [ i ] ; hook ( jcr , fp ) ; } } }
!!!
!!!
/*
       * Call all the jcr debug hooks
       */