Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312021 Details for
Bug 455696
NFS over GFS issue (fatal: assertion "!bd->bd_pinned && !buffer_busy(bh)" failed)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
stress test tool
gen-data.c (text/x-csrc), 4.72 KB, created by
Mark Hlawatschek
on 2008-07-17 09:28:51 UTC
(
hide
)
Description:
stress test tool
Filename:
MIME Type:
Creator:
Mark Hlawatschek
Created:
2008-07-17 09:28:51 UTC
Size:
4.72 KB
patch
obsolete
>/* gen-data.c > * This script creates sample data to analyze GFS behaviour > * 2008-06-30 Initial Version Reiner Rottmann / ATIX AG > * License: GPL > */ > ># include <stdio.h> ># include <stdlib.h> ># include <string.h> ># include <sys/stat.h> ># include <sys/types.h> ># include <time.h> ># include <fcntl.h> ># include <dirent.h> ># include <unistd.h> > >/* file frequencies scenario */ >int freqA=6000; >int freqB=40; >int freqC=3960; >int freqD=1; > >int fsizeA=1024; /* 1kB */ >int fsizeB=1572864; /* 1.5MB */ >int fsizeC=307200; /* 300kB */ > >double maxfiles=1000000000; /* maximum files to generate */ >char* basedir="/tmp/test"; /* basedirectory to use */ > >/* array that include the histogram */ >int array[10000]; > >/* actual file */ >int actualfile=0; > > >void usage() { > printf("gen-data -a sizeA -A freqA -b sizeB -B freqB -c sizeC -C freqC -n files -p pathname\n"); > printf("Defaults: \n"); > printf("\tsizeA=1024 freqA=6000\n"); > printf("\tsizeB=1572864 freqB=40\n"); > printf("\tsizeC=307200 freqC=3960\n"); > printf("\tfiles=1000000000\n"); > printf("\tpath=/tmp/test\n"); > exit(2); >} > >/* function to create directory recursively */ >static void _mkdir(const char *path) { > char opath[256]; > char *p; > size_t len; > > strncpy(opath, path, sizeof(opath)); > len = strlen(opath); > if (opath[len - 1] == '/') > opath[len - 1] = '\0'; > for (p = opath; *p; p++) > if (*p == '/') { > *p = '\0'; > if (access(opath, F_OK)) > mkdir(opath, S_IRWXU); > *p = '/'; > } > if (access(opath, F_OK)) /* if path is not terminated with / */ > mkdir(opath, S_IRWXU); >} > >/* function to shuffle the array according Fisher-Yates algorithm */ >void shuffle(int *pArr, int size) { > int i, tmp, rand; > > time_t now = time(NULL); > if (now == (time_t) -1) { > /* handle error */ > } > srandom(now); /* seed the PRNG with the current time */ > > for (i=size-1; i>0; i--) { > rand = random() % i+1; > tmp=(int)pArr[i]; > pArr[i]=pArr[rand]; > pArr[rand]=(int)tmp; > } >} > >int main(int argc, char* argv[]) { > > int a=0, b=0, c=0; > int rand(void); > int mkdir(const char *pathname, mode_t mode); > FILE *fp; > char filename[255]=""; > > // Set options > extern char *optarg; > extern int optind, optopt, opterr; > while ((c = getopt(argc, argv, ":a:A:b:B:c:C:p:n:")) != -1) { > switch(c) { > case 'a': > fsizeA=atoi(optarg); > break; > case 'A': > freqA=atoi(optarg); > break; > case 'b': > fsizeB=atoi(optarg); > break; > case 'B': > freqB=atoi(optarg); > break; > case 'c': > fsizeC=atoi(optarg); > break; > case 'C': > freqC=atoi(optarg); > break; > case 'n': > maxfiles=atoll(optarg); > break; > case 'p': > basedir=optarg; > break; > case '?': > usage(); > break; > } > } > printf("starting to waste disk space.\n"); > > printf("filling file type histogram.\n"); > > /* fill array with characters according histogram */ > for (a=0; a<freqA; a++) { > array[a]=1; > } > for (b=freqA; b<freqA+freqB; b++) { > array[b]=2; > } > > for (c=freqA+freqB; c<freqA+freqB+freqC; c++) { > array[c]=3; > } > > printf("shuffling file type histogram.\n"); > shuffle(array, 10000); > > /* create directory structure like "/basedir/2008/07/01/12/55/" */ > char directory[255]=""; > time_t now; > struct tm *date; > > /* Get actual time */ > now = time(0); > date = localtime(&now); > > /* Create directory based on date and time */ > sprintf(directory, "%s/%i/%i/%i/%i/%i", basedir, date->tm_year+1900, > date->tm_mon+1, date->tm_mday, date->tm_hour, date->tm_min); > /*printf("%s", directory);*/ > _mkdir(directory); > > printf("writing files."); > > /* create files filled with random data according histogram pattern */ > for (actualfile=0; actualfile<maxfiles; actualfile++) { > > /* Get actual time */ > now = time(0); > date = localtime(&now); > > /* Create directory based on date and time */ > sprintf(directory, "%s/%i/%i/%i/%i/%i", basedir, date->tm_year+1900, > date->tm_mon+1, date->tm_mday, date->tm_hour, date->tm_min); > /*printf("%s", directory);*/ > _mkdir(directory); > > /* Open file for write access */ > sprintf(filename, "%s/%d.dat", directory, actualfile); > > if ((fp=fopen(filename, "wb"))==NULL) { > printf("Cannot open file.\n"); > exit(1); > } > > switch (array[actualfile % 1000]) { > case 1: > fseek(fp, fsizeA, 0); > fputc((int)"1", fp); > //printf("a"); > //fwrite("0\0",1,fsizeA , fp); > ; > > case 2: > fseek(fp, fsizeB, 0); > fputc((int)"2", fp); > //printf("b"); > //fwrite("0\0",1,fsizeB , fp); > ; > > case 3: > fseek(fp, fsizeC, 0); > fputc((int)"3", fp); > //printf("c"); > //fwrite("0\0",1,fsizeC , fp); > ; > > default: > ; > } > fclose(fp); > > /* print a dot for every hundred files. */ > if (actualfile % 100 == 0){ > printf("."); > } > } > printf("\ndone.\n"); > return 0; > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 455696
: 312021 |
317629
|
319176
|
319283
|
319380
|
321732
|
325912
|
328294
|
328592
|
329133
|
329889
|
333550
|
334226
|
334890
|
335529
|
337029
|
348699