mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-05 02:40:37 +00:00
HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build Tracked-On: #3482 Signed-off-by: Terry Zou <terry.zou@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
52
misc/tools/acrn-crashlog/usercrash/include/crash_dump.h
Normal file
52
misc/tools/acrn-crashlog/usercrash/include/crash_dump.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef CRASH_DUMP_H
|
||||
#define CRASH_DUMP_H
|
||||
|
||||
/**
|
||||
* So far, crash_dump use gdb command to dump process info. But in the future,
|
||||
* we will replace gdb command with a better implementation.
|
||||
*/
|
||||
#define GET_GDB_INFO "/usr/bin/gdb %s -batch "\
|
||||
"-ex 'bt' "\
|
||||
"-ex 'printf \"\nRegisters\n\"' "\
|
||||
"-ex 'info registers' "\
|
||||
"-ex 'printf \"\n\nMemory near rax\n\"' "\
|
||||
"-ex 'x/16x $rax-0x20' "\
|
||||
"-ex 'x/48x $rax' "\
|
||||
"-ex 'printf \"\n\nMemory near rbx\n\"' "\
|
||||
"-ex 'x/16x $rbx-0x20' "\
|
||||
"-ex 'x/48x $rbx' "\
|
||||
"-ex 'printf \"\n\nMemory near rcx\n\"' "\
|
||||
"-ex 'x/16x $rcx-0x20' "\
|
||||
"-ex 'x/48x $rcx' "\
|
||||
"-ex 'printf \"\n\nMemory near rdx\n\"' "\
|
||||
"-ex 'x/16x $rdx-0x20' "\
|
||||
"-ex 'x/48x $rdx' "\
|
||||
"-ex 'printf \"\n\nMemory near rsi\n\"' "\
|
||||
"-ex 'x/16x $rsi-0x20' "\
|
||||
"-ex 'x/48x $rsi' "\
|
||||
"-ex 'printf \"\n\nMemory near rdi\n\"' "\
|
||||
"-ex 'x/16x $rdi-0x20' "\
|
||||
"-ex 'x/48x $rdi' "\
|
||||
"-ex 'printf \"\n\nMemory near rbp\n\"' "\
|
||||
"-ex 'x/16x $rbp-0x20' "\
|
||||
"-ex 'x/48x $rbp' "\
|
||||
"-ex 'printf \"\n\nMemory near rsp\n\"' "\
|
||||
"-ex 'x/16x $rsp-0x20' "\
|
||||
"-ex 'x/48x $rsp' "\
|
||||
"-ex 'printf \"\n\ncode around rip\n\"' "\
|
||||
"-ex 'x/8i $rip-0x20' "\
|
||||
"-ex 'x/48i $rip' "\
|
||||
"-ex 'printf \"\nThreads\n\n\"' "\
|
||||
"-ex 'info threads' "\
|
||||
"-ex 'printf \"\nThreads backtrace\n\n\"' "\
|
||||
"-ex 'thread apply all bt' "\
|
||||
"-ex 'quit'"
|
||||
|
||||
void crash_dump(int pid, int sig, int out_fd);
|
||||
|
||||
#endif
|
31
misc/tools/acrn-crashlog/usercrash/include/packet.h
Normal file
31
misc/tools/acrn-crashlog/usercrash/include/packet.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef CLIENT_H
|
||||
#define CLIENT_H
|
||||
|
||||
#define COMM_NAME_LEN 64
|
||||
#define SOCKET_NAME "user_crash"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
enum CrashPacketType {
|
||||
/* Initial request from crash_dump */
|
||||
kDumpRequest = 0,
|
||||
|
||||
/* Notification of a completed crash dump */
|
||||
kCompletedDump,
|
||||
|
||||
/* Responses to kRequest */
|
||||
kPerformDump
|
||||
};
|
||||
|
||||
struct crash_packet {
|
||||
enum CrashPacketType packet_type;
|
||||
int pid;
|
||||
char name[COMM_NAME_LEN];
|
||||
};
|
||||
|
||||
#endif
|
25
misc/tools/acrn-crashlog/usercrash/include/protocol.h
Normal file
25
misc/tools/acrn-crashlog/usercrash/include/protocol.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef PROTOCOL_H
|
||||
#define PROTOCOL_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define RESERVED_SOCKET_PREFIX "/tmp/"
|
||||
#define SOCKET_PATH_MAX 128
|
||||
|
||||
int create_socket_server(const char *name, int type);
|
||||
|
||||
int socket_local_client(const char *name, const size_t len, int type);
|
||||
ssize_t send_fd(int sockfd, const void *data, size_t len, int fd);
|
||||
ssize_t recv_fd(int sockfd, void *data, size_t len, int *out_fd);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user