Exemplo n.º 1
0
void vcos_vlog_default_impl(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, const char *fmt, va_list args)
{
   char *newline = strchr( fmt, '\n' );
   const char  *prefix;
   const char  *real_fmt;

   preempt_disable();
   {
       if ( *fmt == '<' )
       {
           prefix = fmt;
           real_fmt= &fmt[3];
       }
       else
       {
          prefix = log_prefix[_level];
          real_fmt = fmt;
       }
#if defined( CONFIG_BCM_KNLLOG_SUPPORT )
       knllog_ventry( "vcos", real_fmt, args );
#endif
       printk( "%.3svcos: [%d]: ", prefix, current->pid );
       vprintk( real_fmt, args );

       if ( newline == NULL )
       {
          printk("\n");
       }
   }
   preempt_enable();
}
Exemplo n.º 2
0
void vchost_vlog( const char *function, int logType, const char *fmt, va_list args )
{
    if (( logType & 1 ) != 0 )
    {
        // Wrap the multiple calls to printk in preempt_dsiable/enable so that 
        // klogd doesn't try to treat them as 3 separate messages
        
        preempt_disable();
        printk( KERN_INFO "%s: ", function );
        vprintk( fmt, args );
        printk( "\n" );
        preempt_enable();
    }
    if (( logType & 2 ) != 0 )
    {
        knllog_ventry( function, fmt, args );
    }
}