Files
openharmony_kernel_liteos_a/kernel/extended/hidumper/los_hidumper.h
arvinzzz 33d0c1bd0b refactor: 内核目录结构整理
1. 原kernel/common目录下属于内核拓展组件,统一移入kernel/extend管理
2. Kconfig分层,各模块自己的配置放到自己目录下管理
3. 原platform下不属于平台的公共代码抽到kernel/common下,只留板级链接脚本和一些编译脚本指向device目录下触发平台相关的编译
4. 对外公共头文件统一抽到对外include路径
5. 废弃宏,头文件清理

close: #I48KI4

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I0cf5ea81c92a8fa7b113da9cbdc8b7bc935f5aae
2021-09-08 16:36:28 +08:00

88 lines
3.0 KiB
C

/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LOS_HIDUMPER_H
#define LOS_HIDUMPER_H
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#ifndef __user
#define __user
#endif
#define PATH_MAX_LEN 256
enum MemDumpType {
DUMP_TO_STDOUT,
DUMP_REGION_TO_STDOUT,
DUMP_TO_FILE,
DUMP_REGION_TO_FILE
};
struct MemDumpParam {
enum MemDumpType type;
unsigned long long start;
unsigned long long size;
char filePath[PATH_MAX_LEN];
};
struct HiDumperAdapter {
void (*DumpSysInfo)(void);
void (*DumpCpuUsage)(void);
void (*DumpMemUsage)(void);
void (*DumpTaskInfo)(void);
void (*DumpFaultLog)(void);
void (*DumpMemData)(struct MemDumpParam *param);
void (*InjectKernelCrash)(void);
};
#define HIDUMPER_IOC_BASE 'd'
#define HIDUMPER_DUMP_ALL _IO(HIDUMPER_IOC_BASE, 1)
#define HIDUMPER_CPU_USAGE _IO(HIDUMPER_IOC_BASE, 2)
#define HIDUMPER_MEM_USAGE _IO(HIDUMPER_IOC_BASE, 3)
#define HIDUMPER_TASK_INFO _IO(HIDUMPER_IOC_BASE, 4)
#define HIDUMPER_INJECT_KERNEL_CRASH _IO(HIDUMPER_IOC_BASE, 5)
#define HIDUMPER_DUMP_FAULT_LOG _IO(HIDUMPER_IOC_BASE, 6)
#define HIDUMPER_MEM_DATA _IOW(HIDUMPER_IOC_BASE, 7, struct MemDumpParam)
int HiDumperRegisterAdapter(struct HiDumperAdapter *pAdapter);
int OsHiDumperDriverInit(void);
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif