ppc64-diag
Macros | Functions
servicelog.c File Reference

Routines for inserting records into the servicelog database. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <time.h>
#include <librtasevent.h>
#include <sys/wait.h>
#include "rtas_errd.h"

Macros

#define bcd_4b_toint(x)
 
#define bcd_2b_toint(x)
 

Functions

time_t get_event_date (struct event *event)
 Retrieve the timestamp from an event. More...
 
int servicelog_sev (int rtas_sev)
 convert RTAS severity to servicelog severity More...
 
void add_callout (struct event *event, char pri, int type, char *proc, char *loc, char *pn, char *sn, char *ccin)
 Add a new FRU callout to the list for this event. More...
 
void log_event (struct event *event)
 log the event in the servicelog DB More...
 

Detailed Description

Copyright (C) 2005 IBM Corporation

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Macro Definition Documentation

◆ bcd_2b_toint

#define bcd_2b_toint (   x)
Value:
( ((((x) & 0xf0) >> 4) * 10) + \
((((x) & 0xf))))

Referenced by get_event_date().

◆ bcd_4b_toint

#define bcd_4b_toint (   x)
Value:
( ((((x) & 0xf000) >> 12) * 1000) + \
((((x) & 0xf00) >> 8) * 100) + \
((((x) & 0xf0) >> 4) * 10) + \
((((x) & 0xf))))

Referenced by get_event_date().

Function Documentation

◆ add_callout()

void add_callout ( struct event event,
char  pri,
int  type,
char *  proc,
char *  loc,
char *  pn,
char *  sn,
char *  ccin 
)

add_callout

Parameters
eventevent to which to add the callout
pripriority
typetype
procprocedure ID
loclocation code
pnFRU part number
snFRU serial number
ccinFRU ccin

References log_msg().

Referenced by add_more_descrs(), report_src(), and set_srn_and_callouts().

◆ get_event_date()

time_t get_event_date ( struct event event)

get_event_date

Parameters
eventthe event from which to retrieve the timestamp
Returns
the timestamp as time since Epoch, or 0 on failure

References bcd_2b_toint, bcd_4b_toint, log_msg(), event::rtas_event, and event::rtas_hdr.

Referenced by process_pre_v6(), and process_v6().

◆ log_event()

void log_event ( struct event event)

◆ servicelog_sev()

int servicelog_sev ( int  rtas_sev)

servicelog_sev

Parameters
rtas_sevRTAS severity to be converted
Returns
servicelog severity number, SL_SEV_INFO if unknown severity

Referenced by process_pre_v6(), and process_v6().