linux/fs/proc/array.c

// SPDX-License-Identifier: GPL-2.0
/*
 *  linux/fs/proc/array.c
 *
 *  Copyright (C) 1992  by Linus Torvalds
 *  based on ideas by Darren Senn
 *
 * Fixes:
 * Michael. K. Johnson: stat,statm extensions.
 *                      <[email protected]>
 *
 * Pauline Middelink :  Made cmdline,envline only break at '\0's, to
 *                      make sure SET_PROCTITLE works. Also removed
 *                      bad '!' which forced address recalculation for
 *                      EVERY character on the current page.
 *                      <[email protected]>
 *
 * Danny ter Haar    :	added cpuinfo
 *			<[email protected]>
 *
 * Alessandro Rubini :  profile extension.
 *                      <[email protected]>
 *
 * Jeff Tranter      :  added BogoMips field to cpuinfo
 *                      <[email protected]>
 *
 * Bruno Haible      :  remove 4K limit for the maps file
 *			<[email protected]>
 *
 * Yves Arrouye      :  remove removal of trailing spaces in get_array.
 *			<[email protected]>
 *
 * Jerome Forissier  :  added per-CPU time information to /proc/stat
 *                      and /proc/<pid>/cpu extension
 *                      <[email protected]>
 *			- Incorporation and non-SMP safe operation
 *			of forissier patch in 2.1.78 by
 *			Hans Marcus <[email protected]>
 *
 * [email protected]        :  /proc/partitions
 *
 *
 * Alan Cox	     :  security fixes.
 *			<[email protected]>
 *
 * Al Viro           :  safe handling of mm_struct
 *
 * Gerhard Wichert   :  added BIGMEM support
 * Siemens AG           <[email protected]>
 *
 * Al Viro & Jeff Garzik :  moved most of the thing into base.c and
 *			 :  proc_misc.c. The rest may eventually go into
 *			 :  base.c too.
 */

#include <linux/types.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/time_namespace.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/tty.h>
#include <linux/string.h>
#include <linux/mman.h>
#include <linux/sched/mm.h>
#include <linux/sched/numa_balancing.h>
#include <linux/sched/task_stack.h>
#include <linux/sched/task.h>
#include <linux/sched/cputime.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/hugetlb.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/smp.h>
#include <linux/signal.h>
#include <linux/highmem.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/times.h>
#include <linux/cpuset.h>
#include <linux/rcupdate.h>
#include <linux/delayacct.h>
#include <linux/seq_file.h>
#include <linux/pid_namespace.h>
#include <linux/prctl.h>
#include <linux/ptrace.h>
#include <linux/string_helpers.h>
#include <linux/user_namespace.h>
#include <linux/fs_struct.h>
#include <linux/kthread.h>
#include <linux/mmu_context.h>

#include <asm/processor.h>
#include "internal.h"

void proc_task_name(struct seq_file *m, struct task_struct *p, bool escape)
{}

/*
 * The task state array is a strange "bitmap" of
 * reasons to sleep. Thus "running" is zero, and
 * you can test for combinations of others with
 * simple bit tests.
 */
static const char * const task_state_array[] =;

static inline const char *get_task_state(struct task_struct *tsk)
{}

static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
				struct pid *pid, struct task_struct *p)
{}

void render_sigset_t(struct seq_file *m, const char *header,
				sigset_t *set)
{}

static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *sigign,
				    sigset_t *sigcatch)
{}

static inline void task_sig(struct seq_file *m, struct task_struct *p)
{}

static void render_cap_t(struct seq_file *m, const char *header,
			kernel_cap_t *a)
{}

static inline void task_cap(struct seq_file *m, struct task_struct *p)
{}

static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
{}

static inline void task_context_switch_counts(struct seq_file *m,
						struct task_struct *p)
{}

static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
{}

static inline void task_core_dumping(struct seq_file *m, struct task_struct *task)
{}

static inline void task_thp_status(struct seq_file *m, struct mm_struct *mm)
{}

static inline void task_untag_mask(struct seq_file *m, struct mm_struct *mm)
{}

__weak void arch_proc_pid_thread_features(struct seq_file *m,
					  struct task_struct *task)
{}

int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
			struct pid *pid, struct task_struct *task)
{}

static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
			struct pid *pid, struct task_struct *task, int whole)
{}

int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns,
			struct pid *pid, struct task_struct *task)
{}

int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
			struct pid *pid, struct task_struct *task)
{}

int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
			struct pid *pid, struct task_struct *task)
{}

#ifdef CONFIG_PROC_CHILDREN
static struct pid *
get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos)
{}

static int children_seq_show(struct seq_file *seq, void *v)
{}

static void *children_seq_start(struct seq_file *seq, loff_t *pos)
{}

static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void children_seq_stop(struct seq_file *seq, void *v)
{}

static const struct seq_operations children_seq_ops =;

static int children_seq_open(struct inode *inode, struct file *file)
{}

const struct file_operations proc_tid_children_operations =;
#endif /* CONFIG_PROC_CHILDREN */