亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? g4_skews.c

?? disksim是一個非常優(yōu)秀的磁盤仿真工具
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* diskmodel (version 1.1) * Authors: John Bucy, Greg Ganger * Contributors: John Griffin, Jiri Schindler, Steve Schlosser * * Copyright (c) of Carnegie Mellon University, 2003-2005 * * This software is being provided by the copyright holders under the * following license. By obtaining, using and/or copying this * software, you agree that you have read, understood, and will comply * with the following terms and conditions: * * Permission to reproduce, use, and prepare derivative works of this * software is granted provided the copyright and "No Warranty" * statements are included with all reproductions and derivative works * and associated documentation. This software may also be * redistributed without charge provided that the copyright and "No * Warranty" statements are included in all redistributions. * * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH * RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT * INFRINGEMENT.  COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE * OF THIS SOFTWARE OR DOCUMENTATION.   */// The g4 skew analysis works by generating a trace of requests to// issue to the disk, and then analyzing the result of that to derive// the skew values.// The trace follows the structure of the g4 layout search tree for// the disk's layout mapping.  We effectively do a depth-first search// from the top down with a recursive algorithm.  Operating at each// node, we take the lowest LBN in that node as the "zero point" and// measure the angular offset of the first lbn in each entry in the// node from the first entry of the whole node.  Then we recursively// expand the structure of the lbn range of each index entry.// The implementation does both passes in the same code path.#include <libddbg/libddbg.h>#include <libparam/libparam.h>#include <disksim_interface.h>#include "../layout_g4.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include <unistd.h>#include <getopt.h>#define MAX_OUT 4struct dsstuff {  struct disksim_interface *iface;  double now;  double next;  // see the completion callback  double compl[MAX_OUT];  int compl_next;};struct trace {  FILE *fp;};// Disksim parameters to disable the disk cache.static char *nocache_over[] = {  "disk0", "Enable caching in buffer", "0",  "disk0", "Fast write level", "0",   "disk0", "Buffer continuous read", "0",   "disk0", "Read any free blocks", "0",   "disk0", "Minimum read-ahead (blks)", "0",   "disk0", "Maximum read-ahead (blks)", "0"};// forward progress -- max times to loop#define FP 40enum { GENTRACE, CALIB } mode = CALIB;voidschedule_callback(disksim_interface_callback_t fn, 		  double t, 		  void *ctx) {  struct dsstuff *ds = (struct dsstuff *)ctx;  ds->next = t;}voiddeschedule_callback(double t, void *ctx) {  struct dsstuff *ds = (struct dsstuff *)ctx;  ds->next = -1;}// Disksim interface request completion callback.void cb(double t, struct disksim_request *r, void *ctx) {  //  double *d = (double *)ctx;  struct dsstuff *ds = (struct dsstuff *)ctx;  // This is a dumb hack to deal with ds iface being wrong -- the  // ctx here *should* be the per-req ctx (->reqctx) but it doesn't  // have the demux code.    ds->compl[ds->compl_next++] = t;}// Read lbns l1 and l2 back-to-back, timing the second request.  In// trace generation mode, we just print out the IOs we would do.  In// calibration mode, we inject both IOs into an instance of disksim.doubletime_second_request(int l1, int l2, struct dsstuff *ds, struct trace *t,		    struct dm_disk_if *d) {  struct disksim_request *r1, *r2;  ddbg_assert(l1 < d->dm_sectors);  ddbg_assert(l2 < d->dm_sectors);  if(mode == GENTRACE) {    fprintf(t->fp, "%f 0 %d 1 1\n", ds->now, l1);    fprintf(t->fp, "%f 0 %d 1 1\n", ds->now + 0.1, l2);    ds->now += 20.0;  } else {    r1 = calloc(1, sizeof(*r1));    r2 = calloc(1, sizeof(*r2));    r1->blkno = l1;    r1->bytecount = 512;    r1->flags |= DISKSIM_READ;    r1->start = ds->now;    //    r1->reqctx = &t1;      r2->blkno = l2;    r2->bytecount = 512;    r2->flags |= DISKSIM_READ;    r2->start = ds->now + 0.001;    //    r2->reqctx = &t2;      disksim_interface_request_arrive(ds->iface, ds->now, r1);    disksim_interface_request_arrive(ds->iface, ds->now, r2);      // pump disksim    do {      ds->now = ds->next;      ds->next = -1;      disksim_interface_internal_event(ds->iface, ds->now, 0);    } while(ds->next != -1);    // roll now forward slightly, some small ~1ms int-arr    ds->now += 1.0;    free(r1);    free(r2);    //    printf("%d -> %d : %f\n", l1, l2, ds->compl[1] - ds->compl[0]);    ds->compl_next = 0;  }  return ds->compl[1] - ds->compl[0]; }// Open the trace file for reading or writing according to the mode.struct trace *setup_trace(char *name) {  struct trace *t = calloc(1, sizeof(*t));  if(mode == GENTRACE) {    t->fp = fopen(name, "w");  } else {    t->fp = fopen(name, "r");  }  return t;}// Parse the next request in the input trace in disksim "validate"// format.inttrace_get_next(struct trace *t, int *lbn, double *result) {  int rv;  rv = fscanf(t->fp, "%*s %*s %d %*d %lf %*f", lbn, result) == 2;  *result /=  1000.0;    return rv;}// Get the timing for accessing lbn2 after lbn1 from the trace.doubleget_tracetime(struct trace *t, int lbn1, int lbn2) {  double result, t1;  int l1, l2;    do { // try to resync    ddbg_assert(trace_get_next(t, &l1, &t1));  } while(l1 != lbn1);  ddbg_assert(trace_get_next(t, &l2, &result));  ddbg_assert(l1 == lbn1);  ddbg_assert(l2 == lbn2);  return result;}// We actually want the last lbn on the source track.  If you use the// first lbn on the source track, some disks will make it every time,// some will make it about half of the time and have a rotation miss// the other half.intadjust_lbns(struct dm_disk_if *d, int *l1, int *l2) {  struct dm_pbn pbn;  int l0, ln;  if(l1) {    d->layout->dm_translate_ltop(d, *l1, MAP_FULL, &pbn, 0);    d->layout->dm_get_track_boundaries(d, &pbn, &l0, &ln, 0);    *l1 = ln;  }  if(l2) {    d->layout->dm_translate_ltop(d, *l2, MAP_FULL, &pbn, 0);    d->layout->dm_get_track_boundaries(d, &pbn, &l0, &ln, 0);    *l2 = l0;  }  return 0;}// The following functions are used to do a linear least-squares fit// following the article at mathworld.wolfram.comstatic doublemean(double *x, int n) {  int i;  double sum = 0.0;  double mean;  for(i = 0; i < n; i++) {    sum += x[i];  }    mean = sum / n;  return mean;}// sum of squaresstatic doubless(double *x, int n) {  int i;  double sum = 0.0;  double res;  for(i = 0; i < n; i++) {    sum += (x[i] * x[i]);  }  res = sum - n * mean(x,n) * mean(x,n);  return res;}static doublessxy(double *x, double *y, int n) {  int i;  double sum = 0.0;  double res;  for(i = 0; i < n; i++) {    sum += (x[i] * y[i]);  }  res = sum - (n * mean(x,n) * mean(y,n));  return res;}// variancedouble vari(double *x, int n) {  double res = ss(x,n) / n;  return res;}double covar(double *x, double *y, int n) {  double res = ssxy(x,y,n) / n;  return res;}// y = a + bx// The data is the collection of pairs (x[i], y[i]) for i in [0,n)// Returns the correlation coeffecient, rdoublelinreg(double *x, double *y, int n, double *a, double *b) {  double r;  *b = ssxy(x,y,n) / ss(x,n);  *a = mean(y,n) - *b * mean(x,n);  r = sqrt(ssxy(x,y,n) * ssxy(x,y,n) / (ss(x,n) * ss(y,n)));  return r;}// Compute the difference between the samples in d1 and d2, returning// the slope of a line through the points, (i, d1[i] - d2[i])// for i in [0,n)// Returns the y intercept in aa.// Return value is the slope of the fitted line.  If it decides we're// done, returns 0.0doublefind_slope(double *d1, double *d2, int n, double *aa,	   double period) {  int i;  double a,b,r;  double yi;  double *err = calloc(n, sizeof(*err));  double *x = calloc(n, sizeof(*x));  double fit_err, tot_err;  double var;  double thresh = period / 2.0;  int addct = 0;  int n2 = 0;    if(n == 1) {    *aa = d1[0] - d2[0];    return 0.0;  }  if(n == 2) {    *aa = 0.0;    return d1[1] - d2[1];  }  for(i = 1; i < n; i++) {    yi = d1[i] - d2[i];    if(-thresh <= yi && yi <= thresh) {      //      printf("%3d\t%f\n", i, yi);      err[n2] = yi;      x[n2] = i;      n2++;    }  }  r = linreg(x, err, n2, &a, &b);  for(i = 0; i < n2; i++) {    printf("%3d\t%f\n", (int)x[i], err[i]);  }  var = vari(err,n);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人福利电影精品一区二区在线观看| 麻豆精品久久久| 久久一区二区三区国产精品| 欧美日韩精品一区二区| 在线视频观看一区| 欧美日韩亚洲综合一区| 在线亚洲人成电影网站色www| 色综合久久天天| 在线看不卡av| 欧美一级片免费看| 日韩女优制服丝袜电影| 国产网站一区二区| 亚洲免费观看视频| 亚洲电影一区二区三区| 免费在线看一区| 国产最新精品免费| 国产风韵犹存在线视精品| 成人免费av资源| 欧美日韩免费一区二区三区视频| 欧美日韩国产精选| 26uuuu精品一区二区| 国产精品久久久久久久久久久免费看 | 91麻豆.com| 欧美日韩在线播放一区| 日韩欧美三级在线| 欧美激情一区在线| 午夜视频在线观看一区二区| 久久激情五月婷婷| 成人a免费在线看| 91.xcao| 中文文精品字幕一区二区| 伊人婷婷欧美激情| 国精产品一区一区三区mba桃花 | 亚洲国产欧美在线| 国产精品一区免费在线观看| 99国产精品久久久久久久久久| 欧美久久久久久久久| 久久久.com| 亚洲成人一区在线| 成人妖精视频yjsp地址| 91精品免费在线观看| 综合在线观看色| 久久精品久久综合| 欧美日韩日日夜夜| 国产精品少妇自拍| 日本亚洲三级在线| 色又黄又爽网站www久久| 日韩欧美一二三区| 亚洲成人黄色影院| 91香蕉国产在线观看软件| 精品美女在线播放| 午夜精品久久久久久不卡8050| 成人激情黄色小说| 久久久久久久综合日本| 久久草av在线| 777色狠狠一区二区三区| 亚洲六月丁香色婷婷综合久久 | 成人app网站| 精品乱人伦一区二区三区| 亚洲网友自拍偷拍| 99久久精品免费看国产免费软件| 26uuuu精品一区二区| 美腿丝袜亚洲三区| 欧美精品乱码久久久久久按摩| 色综合久久久久综合99| 亚洲综合色婷婷| 欧美v日韩v国产v| 99久久精品国产网站| 亚洲天堂av老司机| 欧美一区二区三区免费| 成人av免费在线| 丝袜a∨在线一区二区三区不卡| 久久久影视传媒| 欧美日本精品一区二区三区| 国产成人三级在线观看| 丝袜国产日韩另类美女| 国产精品久久久久久久久晋中| 91精品久久久久久久99蜜桃| 高清不卡一区二区在线| 天天综合色天天综合| 国产精品免费视频网站| 欧美本精品男人aⅴ天堂| 欧美中文字幕一区| 国产a区久久久| 久久精品免费观看| 亚洲电影中文字幕在线观看| 中文字幕av一区二区三区免费看| 69p69国产精品| 色国产综合视频| 成人黄色免费短视频| 精品午夜久久福利影院| 日韩av电影天堂| 夜夜嗨av一区二区三区| 中文字幕乱码一区二区免费| 精品久久人人做人人爱| 欧美日韩中文字幕一区| 色欧美乱欧美15图片| 成人午夜精品在线| 国产一区二区免费在线| 日本网站在线观看一区二区三区| 1024精品合集| 中文字幕一区二区三中文字幕| 久久亚洲一区二区三区四区| 日韩欧美成人一区| 欧美一三区三区四区免费在线看 | 国产高清精品网站| 久久精品二区亚洲w码| 日本免费新一区视频| 午夜视黄欧洲亚洲| 亚洲国产精品久久久久婷婷884| 中文字幕 久热精品 视频在线 | 成人美女在线观看| 成人一区二区三区| 成人免费观看男女羞羞视频| 国产99久久久国产精品潘金 | 欧美欧美午夜aⅴ在线观看| 欧美主播一区二区三区| 欧美性生活影院| 欧美日韩在线播| 欧美酷刑日本凌虐凌虐| 91精品国产综合久久精品麻豆| 51精品秘密在线观看| 日韩欧美在线一区二区三区| 日韩精品中午字幕| 精品电影一区二区| 国产蜜臀av在线一区二区三区| 国产婷婷色一区二区三区| 国产欧美在线观看一区| 国产精品全国免费观看高清 | 久久精品国产999大香线蕉| 精品无人区卡一卡二卡三乱码免费卡| 日本欧美久久久久免费播放网| 精久久久久久久久久久| 成人亚洲精品久久久久软件| 一本色道久久综合亚洲91| 欧美视频精品在线| 2020国产精品自拍| 国产精品嫩草影院com| 一区二区免费视频| 久久国产人妖系列| youjizz国产精品| 欧美午夜精品一区| 精品国产91久久久久久久妲己 | 久久你懂得1024| 亚洲视频一区二区免费在线观看| 亚洲欧美偷拍三级| 蜜桃视频在线观看一区| 成人免费视频一区| 欧美肥大bbwbbw高潮| 久久久国产精华| 亚洲福利视频导航| 丁香亚洲综合激情啪啪综合| 欧美日韩国产另类一区| 国产女人aaa级久久久级| 亚洲妇女屁股眼交7| 国产盗摄一区二区| 欧美日韩国产中文| 国产精品女主播av| 日本美女视频一区二区| 岛国精品在线播放| 欧美肥大bbwbbw高潮| 亚洲少妇中出一区| 久久69国产一区二区蜜臀| 欧美在线影院一区二区| 久久亚区不卡日本| 日本午夜一本久久久综合| 99国产精品久久久久久久久久| 精品国产乱码久久久久久图片| 亚洲欧美日韩在线不卡| 国产精品影视天天线| 欧美性色aⅴ视频一区日韩精品| 久久久国产综合精品女国产盗摄| 亚洲成人激情自拍| 91蝌蚪国产九色| 国产色爱av资源综合区| 天堂在线亚洲视频| 91美女在线观看| 中文字幕不卡在线播放| 久久99最新地址| 日韩视频一区二区三区在线播放| 亚洲国产欧美在线| 91豆麻精品91久久久久久| 国产精品电影一区二区三区| 激情综合网av| 日韩精品专区在线| 免费高清视频精品| 欧美一卡二卡在线观看| 婷婷国产在线综合| 在线观看成人小视频| 亚洲另类春色国产| 一本一道久久a久久精品| 国产精品国产馆在线真实露脸 | 亚洲视频一区在线| 99精品在线观看视频| 国产精品理伦片| 暴力调教一区二区三区| 国产精品免费人成网站| 91亚洲大成网污www| 亚洲人成影院在线观看| 91丨九色porny丨蝌蚪|