Skip to content

Commit

Permalink
core-*: add missing extern and missing inclusion of header in core*c
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
  • Loading branch information
ColinIanKing committed Aug 19, 2023
1 parent b6e2cd0 commit 55a9ca3
Show file tree
Hide file tree
Showing 27 changed files with 53 additions and 48 deletions.
1 change: 1 addition & 0 deletions core-affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
*/
#include "stress-ng.h"
#include "core-affinity.h"
#include "core-builtin.h"

static const char option[] = "taskset";
Expand Down
4 changes: 2 additions & 2 deletions core-affinity.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_AFFINITY_H
#define CORE_AFFINITY_H

int stress_set_cpu_affinity(const char *arg);
int stress_change_cpu(const stress_args_t *args, const int old_cpu);
extern int stress_set_cpu_affinity(const char *arg);
extern int stress_change_cpu(const stress_args_t *args, const int old_cpu);

#endif
1 change: 0 additions & 1 deletion core-capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,4 @@
#define SHIM_CAP_BPF SHIM_CAP_IS_ROOT
#endif


#endif
1 change: 1 addition & 0 deletions core-cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
#include "stress-ng.h"
#include "core-cpuidle.h"
#include "core-sort.h"

#define MAX_STATES (64)
Expand Down
2 changes: 1 addition & 1 deletion core-cpuidle.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#ifndef CORE_CPUIDLE_H
#define CORE_CPUIDLE_H

void stress_log_cpuidle_info(void);
extern void stress_log_cpuidle_info(void);

#endif
1 change: 1 addition & 0 deletions core-ignite-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "stress-ng.h"
#include "core-arch.h"
#include "core-builtin.h"
#include "core-ignite-cpu.h"

#define SETTING_SCALING_FREQ (0x01)
#define SETTING_CPUINFO_FREQ (0x02)
Expand Down
4 changes: 2 additions & 2 deletions core-ignite-cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_IGNITE_CPU_H
#define CORE_IGNITE_CPU_H

void stress_ignite_cpu_start(void);
void stress_ignite_cpu_stop(void);
extern void stress_ignite_cpu_start(void);
extern void stress_ignite_cpu_stop(void);

#endif
1 change: 1 addition & 0 deletions core-interrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
#include "stress-ng.h"
#include "core-arch.h"
#include "core-interrupts.h"

#define MSR_SMI_COUNT (0x34)

Expand Down
8 changes: 4 additions & 4 deletions core-interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#ifndef CORE_INTERRUPTS_H
#define CORE_INTERRUPTS_H

void stress_interrupts_start(stress_interrupts_t *counters);
void stress_interrupts_stop(stress_interrupts_t *counters);
void stress_interrupts_check_failure(const char *name,
extern void stress_interrupts_start(stress_interrupts_t *counters);
extern void stress_interrupts_stop(stress_interrupts_t *counters);
extern void stress_interrupts_check_failure(const char *name,
stress_interrupts_t *counters, uint32_t instance, int *rc);
void stress_interrupts_dump(FILE *yaml, stress_stressor_t *stressors_list);
extern void stress_interrupts_dump(FILE *yaml, stress_stressor_t *stressors_list);

#endif
2 changes: 1 addition & 1 deletion core-job.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#ifndef CORE_JOB_H
#define CORE_JOB_H

int stress_parse_jobfile(const int argc, char **argv, const char *jobfile);
extern int stress_parse_jobfile(const int argc, char **argv, const char *jobfile);

#endif
6 changes: 3 additions & 3 deletions core-killpid.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#ifndef CORE_KILLPID_H
#define CORE_KILLPID_H

int stress_killpid(const pid_t pid);
int stress_kill_and_wait(const stress_args_t *args, const pid_t pid,
extern int stress_killpid(const pid_t pid);
extern int stress_kill_and_wait(const stress_args_t *args, const pid_t pid,
const int signum, const bool set_stress_force_killed_bogo);
int stress_kill_and_wait_many(const stress_args_t *args, const pid_t *pids,
extern int stress_kill_and_wait_many(const stress_args_t *args, const pid_t *pids,
const size_t n_pids, const int signum,
const bool set_stress_force_killed_bogo);

Expand Down
1 change: 1 addition & 0 deletions core-klog.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/
#include "stress-ng.h"
#include "core-klog.h"

#if defined(__linux__)
static pid_t klog_pid = -1;
Expand Down
4 changes: 2 additions & 2 deletions core-klog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_KLOG_H
#define CORE_KLOH_H

void stress_klog_start(void);
void stress_klog_stop(bool *success);
extern void stress_klog_start(void);
extern void stress_klog_stop(bool *success);

#endif
2 changes: 1 addition & 1 deletion core-limit.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#ifndef CORE_LIMIT_H
#define CORE_LIMIT_H

void stress_set_max_limits(void);
extern void stress_set_max_limits(void);

#endif
8 changes: 4 additions & 4 deletions core-lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#ifndef CORE_LOCK_H
#define CORE_LOCK_H

void *stress_lock_create(void);
int stress_lock_destroy(void *lock_handle);
int stress_lock_acquire(void *lock_handle);
int stress_lock_release(void *lock_handle);
extern void *stress_lock_create(void);
extern int stress_lock_destroy(void *lock_handle);
extern int stress_lock_acquire(void *lock_handle);
extern int stress_lock_release(void *lock_handle);

#endif
4 changes: 2 additions & 2 deletions core-madvise.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_MADVISE_H
#define CORE_MADVISE_H

int stress_madvise_random(void *addr, const size_t length);
void stress_madvise_pid_all_pages(const pid_t pid, const int advise);
extern int stress_madvise_random(void *addr, const size_t length);
extern void stress_madvise_pid_all_pages(const pid_t pid, const int advise);

#endif
4 changes: 2 additions & 2 deletions core-mincore.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_MINCORE_H
#define CORE_MINCORE_H

int stress_mincore_touch_pages(void *buf, const size_t buf_len);
int stress_mincore_touch_pages_interruptible(void *buf, const size_t buf_len);
extern int stress_mincore_touch_pages(void *buf, const size_t buf_len);
extern int stress_mincore_touch_pages_interruptible(void *buf, const size_t buf_len);

#endif
2 changes: 1 addition & 1 deletion core-mlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#ifndef CORE_MLOCK_H
#define CORE_MLOCK_H

int stress_mlock_region(const void *addr_start, const void *addr_end);
extern int stress_mlock_region(const void *addr_start, const void *addr_end);

#endif
4 changes: 2 additions & 2 deletions core-mmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_MMAP_H
#define CORE_MMAP_H

void stress_mmap_set(uint8_t *buf, const size_t sz, const size_t page_size);
int stress_mmap_check( uint8_t *buf, const size_t sz, const size_t page_size);
extern void stress_mmap_set(uint8_t *buf, const size_t sz, const size_t page_size);
extern int stress_mmap_check( uint8_t *buf, const size_t sz, const size_t page_size);

#endif
1 change: 1 addition & 0 deletions core-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
*/
#include "stress-ng.h"
#include "core-module.h"

#if defined(HAVE_LIBKMOD_H) && \
defined(HAVE_LIB_KMOD) && \
Expand Down
4 changes: 2 additions & 2 deletions core-module.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#ifndef CORE_MODULE_H
#define CORE_MODULE_H

int stress_module_load(const char *name, const char *alias,
extern int stress_module_load(const char *name, const char *alias,
const char *options, bool *already_loaded);
int stress_module_unload(const char *name, const char *alias,
extern int stress_module_unload(const char *name, const char *alias,
const bool already_loaded);

#endif
4 changes: 2 additions & 2 deletions core-mounts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_MOUNTS_H
#define CORE_MOUNTS_H

void stress_mount_free(char *mnts[], const int n);
int stress_mount_get(char *mnts[], const int max);
extern void stress_mount_free(char *mnts[], const int n);
extern int stress_mount_get(char *mnts[], const int max);

#endif
4 changes: 2 additions & 2 deletions core-numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef CORE_NUMA_H
#define CORE_NUMA_H

int stress_numa_count_mem_nodes(unsigned long *max_node);
int stress_set_mbind(const char *arg);
extern int stress_numa_count_mem_nodes(unsigned long *max_node);
extern int stress_set_mbind(const char *arg);

#endif
6 changes: 3 additions & 3 deletions core-out-of-memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

typedef int stress_oomable_child_func_t(const stress_args_t *args, void *context);

bool stress_process_oomed(const pid_t pid);
void stress_set_oom_adjustment(const stress_args_t *args, const bool killable);
int stress_oomable_child(const stress_args_t *args, void *context,
extern bool stress_process_oomed(const pid_t pid);
extern void stress_set_oom_adjustment(const stress_args_t *args, const bool killable);
extern int stress_oomable_child(const stress_args_t *args, void *context,
stress_oomable_child_func_t func, const int flag);

#endif
4 changes: 2 additions & 2 deletions core-resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ typedef struct {
#endif
} stress_resources_t;

size_t stress_resources_allocate(const stress_args_t *args, stress_resources_t *resources,
extern size_t stress_resources_allocate(const stress_args_t *args, stress_resources_t *resources,
const size_t num_resources, const size_t pipe_size, const size_t min_mem_free,
const bool do_fork);
void stress_resources_free(const stress_args_t *args, stress_resources_t *resources,
extern void stress_resources_free(const stress_args_t *args, stress_resources_t *resources,
const size_t num_resources);

#endif
4 changes: 2 additions & 2 deletions core-try-open.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#ifndef CORE_TRY_OPEN_H
#define CORE_TRY_OPEN_H

int stress_try_open(const stress_args_t *args, const char *path,
extern int stress_try_open(const stress_args_t *args, const char *path,
const int flags, const unsigned long timeout_ns);
int stress_open_timeout(const char *name, const char *path,
extern int stress_open_timeout(const char *name, const char *path,
const int flags, const unsigned long timeout_ns);

#endif
14 changes: 7 additions & 7 deletions core-vmstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

#include "stress-ng.h"

WARN_UNUSED int stress_set_status(const char *const opt);
WARN_UNUSED int stress_set_vmstat(const char *const opt);
WARN_UNUSED int stress_set_thermalstat(const char *const opt);
WARN_UNUSED int stress_set_iostat(const char *const opt);
WARN_UNUSED char *stress_find_mount_dev(const char *name);
void stress_vmstat_start(void);
void stress_vmstat_stop(void);
extern WARN_UNUSED int stress_set_status(const char *const opt);
extern WARN_UNUSED int stress_set_vmstat(const char *const opt);
extern WARN_UNUSED int stress_set_thermalstat(const char *const opt);
extern WARN_UNUSED int stress_set_iostat(const char *const opt);
extern WARN_UNUSED char *stress_find_mount_dev(const char *name);
extern void stress_vmstat_start(void);
extern void stress_vmstat_stop(void);

#endif

0 comments on commit 55a9ca3

Please sign in to comment.