<commit_before>#include <sys/time.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/resource.h> // needed for getrusage 
/*
 * Memory Gobbler.
 *
 *
 * Basic idea: randomly allocate either anon or file pages
 *
 * * randomizer:
 * * * select the time of holding time:
 * * * init new phase
 * * * select the count of the allocation in transition phase:
 * * * * randomize this count between anon and
 * * * * file mapped pages based on user input ratio.
 * * * * * * within the holding time, randomly touch im-previous phase 				
 * * * * * * * Repeat this till all the files in all list are exhausted.
 *
 * Anon and file mapped pages: Maintain 3:1 ratio
 */

/*
 * TODO: 
 *	Use both the kind of anon pages.
 *	get opt
 * 		phase max time
 */
typedef unsigned long lt_t;
#define NUMS 4096
#define MAX_ALLOC (4096)
#define ms2ns(ms) ((ms)*1000000LL)
/* MAX number of pages*/ 
#define MAX_LIMIT 10000000
#define PAGE_SIZE 4096
/*
 * Concatenator 
 */
/*Enable this for ubuntu or other machines */
#ifdef DEBUG
#undef DEBUG
#endif

#ifdef DEBUG
#define FS "/media/test_files/"
#else
#define FS "/mnt/test_images/"
#endif
#define PATH(name) FS # name

/* This defines maximum allocation in an transition
 *
 */
#define MAX_TRANSITION_CNT 1600
#define MAX_TRANS_HALF (MAX_TRANSITION_CNT/2)

static int num[NUMS];
static char* progname;

/*
 * Statistics: 
 *	counting Anon and Filemapped pages
 */
static lt_t anon_cnt = 0;
static lt_t file_cnt = 0;
static lt_t phase_cnt = 0;
static lt_t alloc_nomore = 0;
struct rusage res;
/*
 * Basically tries to maintain
 * array of list of paths and its<commit_msg>Changed the maximum transition count from 50 to 160<commit_after>#include <sys/time.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/resource.h> // needed for getrusage 
/*
 * Memory Gobbler.
 *
 *
 * Basic idea: randomly allocate either anon or file pages
 *
 * * randomizer:
 * * * select the time of holding time:
 * * * init new phase
 * * * select the count of the allocation in transition phase:
 * * * * randomize this count between anon and
 * * * * file mapped pages based on user input ratio.
 * * * * * * within the holding time, randomly touch im-previous phase 				
 * * * * * * * Repeat this till all the files in all list are exhausted.
 *
 * Anon and file mapped pages: Maintain 3:1 ratio
 */

/*
 * TODO: 
 *	Use both the kind of anon pages.
 *	get opt
 * 		phase max time
 */
typedef unsigned long lt_t;
#define NUMS 4096
#define MAX_ALLOC (4096)
#define ms2ns(ms) ((ms)*1000000LL)
/* MAX number of pages*/ 
#define MAX_LIMIT 10000000
#define PAGE_SIZE 4096
/*
 * Concatenator 
 */
/*Enable this for ubuntu or other machines */
#ifdef DEBUG
#undef DEBUG
#endif

#ifdef DEBUG
#define FS "/media/test_files/"
#else
#define FS "/mnt/test_images/"
#endif
#define PATH(name) FS # name

/* This defines maximum allocation in an transition
 *
 */
#define MAX_TRANSITION_CNT 160
#define MAX_TRANS_HALF (MAX_TRANSITION_CNT/2)

static int num[NUMS];
static char* progname;

/*
 * Statistics: 
 *	counting Anon and Filemapped pages
 */
static lt_t anon_cnt = 0;
static lt_t file_cnt = 0;
static lt_t phase_cnt = 0;
static lt_t alloc_nomore = 0;
struct rusage res;
/*
 * Basically tries to maintain
 * array of list of paths and its
{'fraction_non_alphanumeric': 0.11696551724137931, 'fraction_numerical': 0.022620689655172412, 'mean_word_length': 3.715214564369311, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292410', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1236, 'n_words': 443}