summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/parser/errlparser.C
blob: 11b6d0a298f0678a07f47dbd815aa308cfb09f69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
//  IBM_PROLOG_BEGIN_TAG
//  This is an automatically generated prolog.
//
//  $Source: src/usr/errl/parser/errlparser.C $
//
//  IBM CONFIDENTIAL
//
//  COPYRIGHT International Business Machines Corp. 2011
//
//  p1
//
//  Object Code Only (OCO) source materials
//  Licensed Internal Code Source Materials
//  IBM HostBoot Licensed Internal Code
//
//  The source code for this program is not published or other-
//  wise divested of its trade secrets, irrespective of what has
//  been deposited with the U.S. Copyright Office.
//
//  Origin: 30
//
//  IBM_PROLOG_END
/**
 *  @file errlparser.C
 *
 *  @brief Parse and display committed error logs. Enter
 *  errlparser ? (or -? or -h or --help)   to print help.
 */


#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <string>
using namespace std;


#include <errl/errltypes.H>
#include <hbotcompid.H>
using namespace ERRORLOG;


#define USAGE "\
Usage:\n\
\n\
errlparser [-i] <imagefile> [[-s] <symsfile>] [-l | -d <logid>] [-v]\n\
\n\
Arguments:\n\
  <imagefile>  data file name\n\
  <symsfile>   symbols file name\n\
  -l       summarize all error logs (default)\n\
  -d id    print detail from specific error log\n\
  -s name  explicitly name the symbols file\n\
  -i name  explicitly name the image file\n\
  -v       verbose output to stdout\n\
\n\
Sample command lines:\n\
  errlparser image.bin hbicore.syms       # list logs from a full L3 image\n\
  errlparser image.bin hbicore.syms -d 1  # print detail about log 1\n\
  errlparser buffer.bin       # list logs from pre-extracted storage buffer\n\
  errlparser buffer.bin -d 1  # detail log 1 from pre-extracted storage buffer\n\
\n\
Remarks:\n\
[] If no symbols file name is given, <imagefile> is assumed to be an error\n\
   log storage buffer, usually 64KB in size, that has been pre-extracted\n\
   from an L3 image.\n\
[] All output written to stdout\n\
[] '-s' is optional if the symbols file name contains 'syms'\n\
[] '-i' can be optional in most cases\n\
\n\
Contact: Monte Copeland\n\
"

//------------------------------------------------------------------------
// Stop the program with a message. This message is often USAGE.  Since
// this program will be spawned from traceHB.py, I think we're better
// served sending the error message to stdout, not stderr.  I don't
// think Simics is piping stderr to its console.
void halt( const char * msg )
{
    fprintf( stdout, "%s", msg );

    // exit the process with a non-zero process exit level.
    exit(2);
}




//-------------------------------------------------------------------------
// The file src/include/usr/hbotcompid.H  provide a mapping from  compId_t
// to component name.
// that maps comp id to a string label for it.
struct _errlcompname
{
    const char *    pszName;
    uint32_t  value;
};
typedef _errlcompname  ERRLCOMPNAME_t;

ERRLCOMPNAME_t  g_errlcompnames[] = {
// comps.C generated at build time by a script
// that parses data from src/include/usr/hbotcompid.H.
// Refer to  src/usr/errl/parser/makefile
#include <comps.C>
};

// Given a reason code which has a comp id mangled into
// it, return a char* to the component name. Return
// null if not found, which printf seems to handle
// OK by printing (null).
const char * FindComp( uint16_t reasoncode )
{
    const char * pch = NULL;
    uint32_t id = (reasoncode & 0xFF00 );
    int c = sizeof( g_errlcompnames ) / sizeof( g_errlcompnames[0] );
    for( int i = 0; i < c; i++ )
    {
      if( id == g_errlcompnames[i].value )
      {
          pch = g_errlcompnames[i].pszName;
          break;
      }
    }
    return pch;
}



//------------------------------------------------------------
// Print a hex dump of the input buffer to the output file
// given, probably stdout.

int FormatBytes(  FILE * f,  char * pchInput, int count, int indent )
{
    char             szChars[ 80 ];
    char             szHex[ 80 ];
    char             szOffset[ 64 ];
    char             szWork[ 256 ];
    int              i;
    unsigned int     ul;
    char           * pch;
    char           * pchLine;
    int              cb;
    char           * pszIndent = NULL;



    pszIndent = static_cast<char*>(malloc( indent+1 ));
    memset( pszIndent, 0, indent+1 );
    memset( pszIndent, ' ', indent );



    pchLine = pchInput;


    while( pchLine < pchInput + count )
    {
        /* current offset */
        ul = pchLine - pchInput;

        sprintf( szOffset, "%08X", ul );

        memset( szHex, ' ', sizeof( szHex ));
        pch = szHex;

        cb = ((pchInput+count)-pchLine) > 16 ? 16 : ((pchInput+count)-pchLine);

        for( i = 0; i < cb; i++ )
        {
            ul = (unsigned char) pchLine[ i ];

            sprintf( szWork, "%02x", ul );
            memcpy( pch, szWork, 2 );

            pch += 3;
        }

        szHex[ 23 ] = '-';
        szHex[ 48 ] = 0;

        memset( szChars, 0, sizeof( szChars ));
        for( i = 0; i < cb; i++ )
        {
            szChars[i] = '.';

            int t = pchLine[i];

            if( t > 31  )
            {
              szChars[i] = pchLine[ i ];
            }
        }

        sprintf( szWork, "%s  %s %s", szOffset, szHex, szChars );
        fprintf( f, "%s%s\n", pszIndent, szWork );
        fflush( f );
        pchLine += 16;
    }

    return 0;
}



//-------------------------------------------------------------
// endian stuff
section_header_t*  ConvertSectionHeader( section_header_t* p)
{
    p->cbHeader           = ntohl( p->cbHeader );
    p->cbSection          = ntohl( p->cbSection );
    p->compId             = ntohs( p->compId );
    // sctnVer is byte long
    // subSect is byte long
    return p;
}


//-------------------------------------------------------------
// endian stuff
marker_t*  ConvertMarker( marker_t* p)
{
    p->offsetNext    = ntohl( p->offsetNext );
    p->length        = ntohl( p->length );
    return p;
}



//-------------------------------------------------------------
// endian switch a uint64
uint64_t ntohll( uint64_t i )
{
    uint64_t hi;
    uint64_t lo;
    uint32_t * pword = reinterpret_cast<uint32_t*>(&i);

    hi = ntohl( *pword );
    lo = ntohl( *(pword+1) );

    return (hi<<32)|lo;
}


//-------------------------------------------------------------
// endian stuff
errl_header_t* ConvertErrlHeader( errl_header_t* p )
{
    p->cbytes                = ntohl( p->cbytes );
    p->csections             = ntohl( p->csections );
    p->reasonCode            = ntohs( p->reasonCode );
    // p->modId      is a byte
    // p->sev        is a byte
    // p->eventType  is a byte
    // p->subSys     is a byte
    // p->srcType    is a byte
    p->termState             = ntohl( p->termState );
    p->logId                 = ntohl( p->logId );
    p->user1                 = ntohll( p->user1 );
    p->user2                 = ntohll( p->user2 );
    p->CreationTime          = ntohll( p->CreationTime );
    return p;
}



//-------------------------------------------------------------
// endian stuff
storage_header_t * ConvertStorageHeader(  storage_header_t * p )
{
    p->cbStorage      = ntohl( p->cbStorage );
    p->cInserted      = ntohl( p->cInserted );
    p->offsetMarker   = ntohl( p->offsetMarker );
    p->offsetStart    = ntohl( p->offsetStart );
    return p;
}



//-----------------------------------------------------------------------
// Given the binary image file name, return the errl storage part of the file.
// Caller must endian convert anything/everything in the output buffer.
// This function will allocate (malloc) the buffer and return a pointer to it.
// On fatal error, this function will print a diagnostic and end the process.
// Return how many bytes allocated for the buffer in io_cbBuffer.
char* ReadStorageBuffer(char* i_Image, uint32_t i_ulAddr, uint32_t &io_cbBuffer)
{
    int fd;
    int rc;
    int cb;
    off_t offsetEnd;
    char * l_pchBuffer = NULL;   // pointer to return
    storage_header_t header;

    // open the image file and read the errl log buffer
    fd = open( i_Image, O_RDONLY );
    if ( fd == -1 )
    {
        // write the error to stdout because more likely to be seen in Simics
        fprintf(stdout, "Unable to open %s for reading.\n", i_Image);
        fprintf(stdout, "Failed with errno %s\n", strerror(errno) );
        exit(2);
    }

    offsetEnd = lseek( fd, 0, SEEK_END );
    if( i_ulAddr >= offsetEnd )
    {
        fprintf( stdout, "Image file %s appears to be truncated. "
                         "Offset 0x%X exceeds size of image file.\n",
                         i_Image, i_ulAddr );
        exit(2);
    }

    rc = lseek( fd, i_ulAddr, SEEK_SET );
    assert( -1 != rc );


    // Read just the header for the size of the buffer is
    // stored in the header.
    cb = read( fd, &header, sizeof( header ));
    assert( -1 != cb );

    // endian convert this copy of the header
    ConvertStorageHeader( &header );

    // io_cbBuffer is a count of bytes in storage
    io_cbBuffer = header.cbStorage;

    if( io_cbBuffer > ( 5 * ERRL_STORAGE_SIZE ))
    {
        // Unreasonable
        fprintf( stdout, "Problem with image file %s\n", i_Image );
        fprintf( stdout, "Buffer size %d is unreasonable.\n", io_cbBuffer );
        exit(2);
    }

    if( ( i_ulAddr + io_cbBuffer ) > offsetEnd )
    {
        fprintf( stdout, "Image file %s appears to be truncated. "
                         "Offset 0x%X exceeds size of image file.\n",
                         i_Image, i_ulAddr+io_cbBuffer );
        exit(2);
    }

    // re-seek and re-read entire buffer this time.
    rc = lseek( fd, i_ulAddr, SEEK_SET );
    assert( -1 != rc );

    l_pchBuffer = static_cast<char *>(malloc( io_cbBuffer ));
    assert( l_pchBuffer );

    cb = read( fd, l_pchBuffer, io_cbBuffer );
    assert( -1 != cb );

    close( fd );
#if 0
    {
      // Write the error log storage buffer to its own file.
      // Offsets stored in the buffer are relative to the
      // start of the buffer.  When this file is saved in
      // its own file, the same offsets are relative to the
      // start of the file. This is convenient when debugging.
      fd = open( "storagebuffer.bin", O_CREAT | O_RDWR, 0666 );
      if(  -1 != fd )
      {
        write( fd, l_pchBuffer, io_cbBuffer );
        close( fd );
      }
    }
#endif
    return l_pchBuffer;
}






//----------------------------------------------------------------------------
// Open the given symbols file name, a text file, and find the storage address
// of error logs given by the symbol in pszSearch.
uint32_t FindSymbol( char * pszSymbolFile,  const char * pszSearch )
{
    char * pszAddr = NULL;
    char * pch;
    char szWork[ 1024 ];
    uint32_t ulAddr = 0;
    FILE * f;

    f = fopen( pszSymbolFile, "r" );
    if ( !f )
    {
        fprintf(stdout, "Unable to open file %s for reading.\n", pszSymbolFile);
        fprintf(stdout, "Failed with errno %s\n", strerror(errno) );
        exit(2);
    }

    while( fgets( szWork, sizeof( szWork ), f ))
    {
        pch = strstr( szWork, pszSearch );
        if( pch )
        {
            pszAddr = szWork + 2;
            pch = strchr( pszAddr, ',' );
            assert( pch );
            *pch = 0;
            break;
        }
    }
    fclose(f);

    if( NULL == pszAddr )
    {
        fprintf( stdout, "Cannot find %s in syms file.\n", pszSearch );
        exit(2);
    }

    int c = sscanf( pszAddr, "%x", &ulAddr );
    if( 1 != c )
    {
        fprintf( stdout,
                 "Error, expecting '%s' to convert to hexidecimal.\n",
                 pszAddr );
        exit(2);
    }
    return ulAddr;
}



// --------------------------------------------------------------------------
// Print a summary of the error log, no user-defined data nor detail.
// perrlog is already endian converted

void PrintErrlSummary(  errl_header_t * perrlog  )
{

    // print headline
    //      comp  id   sev rc  mod  evt   u1    u2   csec
    printf( "%-7s %10s %4s %-6s %-4s %-4s %-18s %-18s %5s\n",
      "comp",
      "logid",
      "sev",
      "reason",
      "mod",
      "evnt",
      "user1",
      "user2",
      "csect"  );


    //       comp   id   sev    reason  mod   event  user1     user2     csec
    //                          code
    printf( "%-7s %10d 0x%02x 0x%04x 0x%02x 0x%02x 0x%016llx 0x%016llx %5d\n",
          FindComp( perrlog->reasonCode ),
          perrlog->logId,
          perrlog->sev,
          perrlog->reasonCode,
          perrlog->modId,
          perrlog->eventType,
          perrlog->user1,
          perrlog->user2,
          perrlog->csections      // count of sections
    );
}


//---------------------------------------------------------------------------
//
//
void PrintErrlDetail(  errl_header_t * perrlog  )
{

    // print the summary line
    PrintErrlSummary(  perrlog  );

    // print sections if any
    if( perrlog->csections )
    {
        int i;
        section_header_t* psect;

        // first section header resides just past the errl_header_t
        psect = reinterpret_cast<section_header_t*>(perrlog+1);

        // Endian convert it
        ConvertSectionHeader( psect );

        i = 0;
        do
        {
            printf(
              "\nSection %d: %-8s len=0x%04x, ver=0x%04x, subsection=0x%04x\n",
              i,
              FindComp( psect->compId ),
              psect->cbSection,
              psect->sctnVer,
              psect->subSect
            );

            // The user-provided data resides just past the section header.
            char * pUserData = reinterpret_cast<char*>(psect+1);

            // Print a hex dump (for now) of the user-provided data.
            FormatBytes( stdout, pUserData, (int)psect->cbSection, 4 );

            i++;
            if( i >= perrlog->csections )
            {
                // Leave the loop, and do not ConvertSectionHeader().
                break;
            }

            // There's more; point to the next section.
            int cb = psect->cbHeader + psect->cbSection;
            char * p =  (reinterpret_cast<char*>(psect)) + cb;
            psect = reinterpret_cast<section_header_t*>(p);

            // Endian convert it.
            ConvertSectionHeader( psect );
        }
        while( 1 );
    }
}






//-------------------------------------------------------------
int main( int argc,  char *argv[] )
{
    char * pch;
    char * pszImageFile = NULL;
    char * pszSymbolFile = NULL;
    char szWork[ 1024 ];
    unsigned char * puch;
    char * pszSearch;
    char * pszAddr = NULL;
    char * pchBuffer;
    uint32_t ulAddr = 0;
    char szDivider[ 256 ];
    uint32_t ulLogId = 0;
    int c;
    int cb;
    int cbSearch;
    int fd;
    int i;
    int k;
    int item;
    int fOK;
    int rc;
    int exitcode = 0;
    uint32_t cbBuffer = 0;
    off_t offset;
    off_t offsetEnd;
    int fVerbose = 0;
    int fList = 1;
    int fDetail = 0;
    int fFound = 0;


    // build a =========== divider for printfing
    cb = 84;
    assert( cb < sizeof( szDivider ));
    memset( szDivider, '=', sizeof( szDivider ));
    szDivider[ cb ] = 0;


    // Examine args.
    i = 1;
    while ( i < argc )
    {
        if( 0 == strcmp( "-v", argv[i] ))
        {
            fVerbose = 1;
        }
        else if( 0 == strcmp( "-d", argv[i] ))
        {
            i++;
            if( i >= argc )
            {
              fprintf( stdout, "Provide -d <logid>\n" );
              exit( 2 );
            }
            int c = sscanf( argv[i], "%d", &ulLogId );
            if( c != 1 )
            {
              fprintf( stdout, "Provide -d <decimal log ID>\n" );
              exit( 2 );
            }
            fList = 0;
            fDetail = 1;
        }
        else if( 0 == strcmp( "-i", argv[i] ))
        {
            i++;
            if( i >= argc )
            {
              fprintf( stdout, "Provide -i <imagefile>\n" );
              exit( 2 );
            }
            pszImageFile = strdup( argv[i] );
        }
        else if( 0 == strcmp( "-s", argv[i] ))
        {
            i++;
            if( i >= argc )
            {
              fprintf( stdout, "Provide -s <symsfile>\n" );
              exit( 2 );
            }
            pszSymbolFile = strdup( argv[i] );
        }
        else if( 0 == strcmp( "-l", argv[i] ))
        {
            fList = 1;
            fDetail = 0;
        }
        else if( 0 == strcmp("?", argv[i]) ||
                 0 == strcmp("-?", argv[i]) ||
                 0 == strcmp("-h", argv[i]) ||
                 0 == strcmp("--help", argv[i]))
        {
            // help
            halt( USAGE );
        }
        else if( 0 == strcmp( "-", argv[i] ))
        {
            // unrecognized switch
            halt( USAGE );
        }
        else
        {
            // must be a file name
            pch = strstr( argv[i], "syms" );
            if( pch )
            {
                if( pszSymbolFile )
                {
                    halt( USAGE );
                }
                pszSymbolFile = strdup( argv[i] );
            }
            else
            {
                if( pszImageFile )
                {
                    halt( USAGE );
                }
                pszImageFile = strdup( argv[i] );
            }
        }

        i++;
    }


    // Check args.
    if( !pszImageFile )
    {
        halt( USAGE );
    }


    if( pszSymbolFile )
    {
        // Given the symbols file, locate the address/offset of the
        // errl storage buffer.
        ulAddr = FindSymbol( pszSymbolFile, "g_ErrlStorage" );
        if( fVerbose )
        {
            printf( "Error log storage buffer offset: 0x%08x\n", ulAddr );
        }
    }
    else
    {
        // No symbols file name given.
        // Proceed as though the image file is the 64KB storage buffer,
        // already extracted for me. This is the case for awan.
        ulAddr = 0;
        if( fVerbose )
        {
            printf( "Assuming '%s' is errl storage buffer.\n", pszImageFile );
        }
    }


    // Given the image file, read the portion that contains the
    // error log storage buffer.
    pchBuffer = ReadStorageBuffer( pszImageFile, ulAddr, cbBuffer );
    assert( pchBuffer );
    assert( cbBuffer );
    if( fVerbose )
    {
        printf("Errlog storage buffer size: %d (decimal) bytes\n", cbBuffer );
    }


    // Convert the endianess of the storage header.
    storage_header_t* pHeader = reinterpret_cast<storage_header_t*>(pchBuffer);
    ConvertStorageHeader( pHeader );
    if( fVerbose )
    {
        printf( "%d error logs were committed.\n", pHeader->cInserted );
        printf( "Start offset:  0x%08x\n",  pHeader->offsetStart );
        printf( "Ending offset: 0x%08x\n",  pHeader->offsetMarker );
    }


/** @brief Convert an offset to a marker_t pointer.       */
#define OFFSET2MARKER(offset) (reinterpret_cast<marker_t*>(pchBuffer+offset))


/** @brief Convert a marker_t pointer to an offset within the buffer. */
#define MARKER2OFFSET(p) ((reinterpret_cast<char*>(p))-pchBuffer)



    // Count how many error logs found
    int logcount = 0;

    // Traverse the list of error logs in the buffer.  At this time, the
    // buffer does not wrap. It is a straight shot from start to finish.
    // Follow the markers.  The start-of-list marker:
    marker_t* pMarker = ConvertMarker( OFFSET2MARKER(pHeader->offsetStart));

    while( 1 )
    {
        if( fVerbose )
        {
            cb = printf( "Marker at 0x%06x: next 0x%06x, length 0x%06x\n",
                         MARKER2OFFSET(pMarker),
                         pMarker->offsetNext,
                         pMarker->length );
        }

        if( pMarker->offsetNext == 0 )
        {
            // This is the list-ending marker.
            printf( "%s\n", szDivider );
            break;
        }

        assert( pMarker->length );

        logcount++;

        // Flattened struct of an error log resides just past marker.
        errl_header_t* perr = reinterpret_cast<errl_header_t*>(pMarker+1);
        ConvertErrlHeader( perr );

        if( fList )
        {
            // Just list the error log headers.
            printf( "%s\n", szDivider );
            PrintErrlSummary( perr );
        }
        else if(( fDetail ) && ( perr->logId ==  ulLogId ))
        {
            // Print the detail for the one error log.
            printf( "%s\n", szDivider );
            PrintErrlDetail( perr );
            fFound = 1;
        }

        // next marker/error log
        pMarker = ConvertMarker( OFFSET2MARKER(pMarker->offsetNext) );
    }


    if( fVerbose )
    {
        printf( "%d error logs found.\n", logcount );
    }

    if( fDetail  &&  !fFound )
    {
        printf( "Error log %d not found.\n", ulLogId );
        exitcode = 2;
    }
    return exitcode;
}

OpenPOWER on IntegriCloud