ppc64-diag
|
Command to extract a platform dump and copy it to the filesystem. More...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#include <stdarg.h>
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
#include <stdint.h>
#include <librtas.h>
#include <sys/stat.h>
#include "rtas_errd.h"
#include "platform.h"
Macros | |
#define | DUMP_HDR_PREFIX_OFFSET 0x16 /* prefix size in dump header */ |
#define | DUMP_HDR_FNAME_OFFSET 0x18 /* suggested filename in dump header */ |
#define | DUMP_MAX_FNAME_LEN 40 |
#define | TOKEN_PLATDUMP_MAXSIZE 32 |
#define | DUMP_BUF_SZ 4096 |
Functions | |
void | msg (char *fmt,...) |
Print message if verbose flag is set. More... | |
static void | print_usage (const char *name) |
Print the usage message for this command. More... | |
static void | handle_platform_dump_error (int e, char *err_buf, int sz) |
Interpret librtas return codes. More... | |
void | remove_old_dumpfiles (char *dumpname, int prefix_size) |
if needed, remove any old dumpfiles More... | |
int | extract_platform_dump (uint64_t dump_tag) |
Extract a platform dump with a given tag to the filesystem. More... | |
int | main (int argc, char *argv[]) |
Variables | |
int | flag_v = 0 |
static struct option | long_options [] |
Copyright (C) 2007 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.
#define DUMP_BUF_SZ 4096 |
Referenced by extract_platform_dump().
#define DUMP_HDR_FNAME_OFFSET 0x18 /* suggested filename in dump header */ |
Referenced by extract_platform_dump().
#define DUMP_HDR_PREFIX_OFFSET 0x16 /* prefix size in dump header */ |
Referenced by extract_platform_dump().
#define DUMP_MAX_FNAME_LEN 40 |
Referenced by extract_platform_dump(), and remove_old_dumpfiles().
#define TOKEN_PLATDUMP_MAXSIZE 32 |
Referenced by main().
int extract_platform_dump | ( | uint64_t | dump_tag | ) |
extract_platform_dump
dump_tag | tag of the platform dump to extract |
References d_cfg, DUMP_BUF_SZ, DUMP_HDR_FNAME_OFFSET, DUMP_HDR_PREFIX_OFFSET, DUMP_MAX_FNAME_LEN, handle_platform_dump_error(), msg(), ppc64_diag_config::platform_dump_path, remove_old_dumpfiles(), and RTAS_ERROR_LOG_MAX.
Referenced by main().
|
static |
handle_platform_dump_error Interpret a return code from librtas for any librtas specific messages.
e | return code from librtas |
err_buf | buffer to write librtas message to |
sz | size of the err_buf parameter |
Referenced by extract_platform_dump().
int main | ( | int | argc, |
char * | argv[] | ||
) |
References config_file, diag_cfg(), extract_platform_dump(), flag_v, long_options, msg(), and print_usage().
void msg | ( | char * | fmt, |
... | |||
) |
msg
fmt | format string a la printf() |
... | additional args a la printf() |
References flag_v.
Referenced by extract_platform_dump(), main(), process_v3_logs(), remove_old_dumpfiles(), report_menugoal(), and report_src().
|
static |
void remove_old_dumpfiles | ( | char * | dumpname, |
int | prefix_size | ||
) |
remove_old_dumpfiles Users can specify the number of old dumpfiles they wish to save via the config file PlatformDumpMax entry. This routine will search through and removeany dump files of the specified type if the count exceeds the maximum value.
dumpname | suggested filename of the platform dump |
prefix_size | length of the prefix |
References d_cfg, DUMP_MAX_FNAME_LEN, msg(), and ppc64_diag_config::platform_dump_path.
Referenced by extract_platform_dump().
|
static |
Referenced by main().