Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTP: fix linux testcases build error on vela #1

Merged
Merged
2 changes: 2 additions & 0 deletions include/old/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <stdlib.h>
#include <stdint.h>

#include "lapi/syscalls.h"

#include "usctest.h"

#include "tst_common.h"
Expand Down
2 changes: 2 additions & 0 deletions include/tst_safe_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef TST_SAFE_PTHREAD_H__
#define TST_SAFE_PTHREAD_H__

#include <pthread.h>

/*
* Macro to use for making functions called only once in
* multi-threaded tests such as init or cleanup function.
Expand Down
6 changes: 6 additions & 0 deletions include/tst_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
#include <limits.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <stdbool.h>

#include "lapi/syscalls.h"
#include "tst_common.h"
#include "tst_res_flags.h"
#include "tst_checkpoint.h"
Expand Down Expand Up @@ -311,8 +314,11 @@ char *tst_get_tmpdir(void);

static struct tst_test test;

static char **av;

int main(int argc, char *argv[])
{
av = argv;
tst_run_tcases(argc, argv, &test);
}

Expand Down
1 change: 1 addition & 0 deletions lib/parse_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <string.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
Expand Down
2 changes: 2 additions & 0 deletions lib/self_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ char *child_args; /* Arguments to child when -C is used */

static char *start_cwd; /* Stores the starting directory for self_exec */

#ifndef HAVE_ASPRINTF
int asprintf(char **app, const char *fmt, ...)
{
va_list ptr;
Expand Down Expand Up @@ -67,6 +68,7 @@ int asprintf(char **app, const char *fmt, ...)

return rv;
}
#endif

void maybe_run_child(void (*child) (), const char *fmt, ...)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/tst_virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* 02110-1301, USA.
*/

#include <sys/wait.h>

#include <unistd.h>
#include "test.h"
#include "safe_macros.h"
Expand Down
56 changes: 28 additions & 28 deletions testcases/kernel/fs/mongo/reiser_fract_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ long stats = 0;

void print_usage()
{
printf("
This program creates files in a tree of random depth and branching. Files vary
in size randomly according to a distribution function which seems to model real
file systems. This distribution function has a median size of median_file_size
(Median file size is hypothesized to be proportional to the average per file
space wastage. Notice how that implies that with a more efficient file system
file size usage patterns will in the long term move to a lower median file
size), and a maximum size of max_file_size. Directories vary in size according
to the same distribution function but with separate parameters to control median
and maximum size for the number of files within them, and the number of
subdirectories within them. This program prunes some empty subdirectories in a
way that causes parents of leaf directories to branch less than
median_dir_branching.

To avoid having one large file distort the results such that you have
to benchmark many times set max_file_size to not more than
bytes_to_consume/10. If maximum/median is a small integer, then
randomness is very poor. This is a bug, Nikita, please find some
clever way to fix it. If it is 0, then the program crashes....

For isolating performance consequences of design variations on
particular file or directory size ranges, try setting their median size and
max_size to both equal the max size of the file size range you want
to test.

To avoid having one large file distort the results set max_file_size to
not more than bytes_to_consume/10. Using a distribution function for
the sizes of writes would be a natural next step in developing this program.\n\n");
printf(
"This program creates files in a tree of random depth and branching. Files vary"
"in size randomly according to a distribution function which seems to model real"
"file systems. This distribution function has a median size of median_file_size"
"(Median file size is hypothesized to be proportional to the average per file"
"space wastage. Notice how that implies that with a more efficient file system"
"file size usage patterns will in the long term move to a lower median file"
"size), and a maximum size of max_file_size. Directories vary in size according"
"to the same distribution function but with separate parameters to control median"
"and maximum size for the number of files within them, and the number of"
"subdirectories within them. This program prunes some empty subdirectories in a"
"way that causes parents of leaf directories to branch less than"
"median_dir_branching."

" To avoid having one large file distort the results such that you have"
"to benchmark many times set max_file_size to not more than"
"bytes_to_consume/10. If maximum/median is a small integer, then"
"randomness is very poor. This is a bug, Nikita, please find some"
"clever way to fix it. If it is 0, then the program crashes...."

"For isolating performance consequences of design variations on"
"particular file or directory size ranges, try setting their median size and"
"max_size to both equal the max size of the file size range you want"
"to test."

"To avoid having one large file distort the results set max_file_size to"
"not more than bytes_to_consume/10. Using a distribution function for"
"the sizes of writes would be a natural next step in developing this program.\n\n");

printf
("Usage: reiser_fract_tree bytes_to_consume median_file_size max_file_size median_dir_nr_files max_directory_nr_files median_dir_branching max_dir_branching write_buffer_size /testfs_mount_point print_stats_flag\n\n");
Expand Down
1 change: 1 addition & 0 deletions testcases/kernel/syscalls/fstat/fstat03.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include "tst_test.h"
#include "tst_safe_macros.h"

Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/ipc/lib/ipcsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern key_t semkey; /* an IPC key generated by ftok() */

void rm_sema(int sem_id);

int getipckey();
key_t getipckey();
int getuserid(char *);

#endif /* ipcsem.h */
1 change: 1 addition & 0 deletions testcases/kernel/syscalls/pipe2/pipe2_02.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "lapi/fcntl.h"
#include "tst_test.h"

Expand Down
27 changes: 0 additions & 27 deletions testcases/kernel/syscalls/utils/poll.h

This file was deleted.

Loading