2010-09-23 17:01:41 +04:00
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2012-07-18 21:07:51 +04:00
# pragma once
2010-09-23 17:01:41 +04:00
/***
This file is part of systemd .
Copyright 2010 Lennart Poettering
systemd is free software ; you can redistribute it and / or modify it
2012-04-12 02:20:58 +04:00
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation ; either version 2.1 of the License , or
2010-09-23 17:01:41 +04:00
( at your option ) any later version .
systemd is distributed in the hope that it will be useful , but
WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
2012-04-12 02:20:58 +04:00
Lesser General Public License for more details .
2010-09-23 17:01:41 +04:00
2012-04-12 02:20:58 +04:00
You should have received a copy of the GNU Lesser General Public License
2010-09-23 17:01:41 +04:00
along with systemd ; If not , see < http : //www.gnu.org/licenses/>.
* * */
# include <sys/stat.h>
2010-09-28 23:46:14 +04:00
# include <sys/types.h>
# include "macro.h"
2012-06-22 01:53:20 +04:00
# include "util.h"
2010-09-23 17:01:41 +04:00
2011-10-11 03:43:58 +04:00
# define READAHEAD_FILE_SIZE_MAX (10*1024*1024)
2010-09-23 17:01:41 +04:00
2012-06-06 00:32:20 +04:00
# define READAHEAD_PACK_FILE_VERSION ";VERSION=2\n"
2012-06-22 01:53:20 +04:00
extern unsigned arg_files_max ;
extern off_t arg_file_size_max ;
extern usec_t arg_timeout ;
2010-09-25 17:39:38 +04:00
int file_verify ( int fd , const char * fn , off_t file_size_max , struct stat * st ) ;
2010-09-23 17:01:41 +04:00
int fs_on_ssd ( const char * p ) ;
2011-03-04 01:03:26 +03:00
int fs_on_read_only ( const char * p ) ;
2010-09-23 17:01:41 +04:00
2010-09-25 15:32:54 +04:00
bool enough_ram ( void ) ;
2010-09-26 17:50:14 +04:00
int open_inotify ( void ) ;
2010-09-28 23:46:14 +04:00
typedef struct ReadaheadShared {
pid_t collect ;
pid_t replay ;
} _packed_ ReadaheadShared ;
ReadaheadShared * shared_get ( void ) ;
2012-05-04 02:13:20 +04:00
int block_bump_request_nr ( const char * p ) ;
int block_get_readahead ( const char * p , uint64_t * bytes ) ;
int block_set_readahead ( const char * p , uint64_t bytes ) ;
2010-10-26 23:28:39 +04:00
2012-06-22 01:53:20 +04:00
int main_collect ( const char * root ) ;
int main_replay ( const char * root ) ;
int main_analyze ( const char * pack_path ) ;