2019-10-25 23:23:02 +01:00
|
|
|
// Copyright 2019 - Omar Sandoval
|
|
|
|
// SPDX-License-Identifier: GPL-3.0+
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Helpers implemented in C.
|
|
|
|
*
|
|
|
|
* Most drgn helpers are implemented in Python. However, there are a few that we
|
|
|
|
* need internally in libdrgn, so they are implemented in C, instead.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DRGN_HELPERS_H
|
|
|
|
#define DRGN_HELPERS_H
|
|
|
|
|
|
|
|
struct drgn_error *
|
|
|
|
linux_helper_radix_tree_lookup(struct drgn_object *res,
|
|
|
|
const struct drgn_object *root, uint64_t index);
|
|
|
|
|
|
|
|
struct drgn_error *linux_helper_idr_find(struct drgn_object *res,
|
|
|
|
const struct drgn_object *idr,
|
|
|
|
uint64_t id);
|
|
|
|
|
|
|
|
struct drgn_error *linux_helper_find_pid(struct drgn_object *res,
|
|
|
|
const struct drgn_object *ns,
|
|
|
|
uint64_t pid);
|
|
|
|
|
|
|
|
struct drgn_error *linux_helper_pid_task(struct drgn_object *res,
|
|
|
|
const struct drgn_object *pid,
|
|
|
|
uint64_t pid_type);
|
|
|
|
|
|
|
|
struct drgn_error *linux_helper_find_task(struct drgn_object *res,
|
|
|
|
const struct drgn_object *ns,
|
|
|
|
uint64_t pid);
|
|
|
|
|
2019-10-28 09:38:51 +00:00
|
|
|
struct drgn_error *
|
|
|
|
linux_helper_task_state_to_char(const struct drgn_object *task, char *ret);
|
|
|
|
|
2019-10-25 23:23:02 +01:00
|
|
|
#endif /* DRGN_HELPERS_H */
|