当前位置: 首页>>代码示例>>C++>>正文


C++ proc_calc_metrics函数代码示例

本文整理汇总了C++中proc_calc_metrics函数的典型用法代码示例。如果您正苦于以下问题:C++ proc_calc_metrics函数的具体用法?C++ proc_calc_metrics怎么用?C++ proc_calc_metrics使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了proc_calc_metrics函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: linux_version_read_proc

static int linux_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
        /* MTD-BSP-VT-PROC-00* */
	len = snprintf(page, count, "%s.%s.%s.%s.%s.%s\n",
		VER_LINUX_BSP_Version,
		VER_LINUX_Platform_Number,
		VER_LINUX_Image_Type, 
		VER_LINUX_Branch_Number,
		VER_LINUX_Build_Number_Major,
		VER_LINUX_Build_Number_Minor);
		
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:NoelMacwan,项目名称:SXDMesona,代码行数:15,代码来源:fih_proc_fs.c

示例2: loadavg_read_proc

static int loadavg_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int a, b, c;
	int len;

	a = avenrun[0] + (FIXED_1/200);
	b = avenrun[1] + (FIXED_1/200);
	c = avenrun[2] + (FIXED_1/200);
	len = sprintf(page,"%d.%02d %d.%02d %d.%02d %d/%d %d\n",
		LOAD_INT(a), LOAD_FRAC(a),
		LOAD_INT(b), LOAD_FRAC(b),
		LOAD_INT(c), LOAD_FRAC(c),
		nr_running, nr_threads, last_pid);
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:16,代码来源:proc_misc.c

示例3: app_tag_read_proc

static int app_tag_read_proc(char* page, char** start, off_t off, int count, int* eof, void *data)
{
    int len = 0;
    u32 charge_flag;
	u32 recovery_flag;  

	recovery_flag = get_recovery_flag();
    charge_flag = get_charge_flag();
    
    len = snprintf(page, PAGE_SIZE,
					"recovery_flag:\n%d\n"
					"charge_flag:\n%d\n",
					recovery_flag,
					charge_flag);
    return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:16,代码来源:app_info.c

示例4: proc_board_status_read

static int proc_board_status_read (char *page, char **start, off_t off,
				   int count, int *eof, void *data)
{
	struct klife_board *board = data;
	int len;

	read_lock (&board->lock);
	len = snprintf (page, count, "Mode:\t\t%s\nEnabled:\t%s\nSide:\t\t%d\nAlloc side:\t%u\nPages:\t\t%llu\n",
			board_mode_as_string (board->mode),
			board->enabled ? "yes" : "no",
			board->side,
			board->field_side,
			board->field ? (1ULL << board->pages_power) : 0);
	read_unlock (&board->lock);

	return proc_calc_metrics (page, start, off, count, eof, len);
}
开发者ID:Shmuma,项目名称:klife,代码行数:17,代码来源:klife-proc.c

示例5: device_model_read_proc

static int device_model_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	int pi = fih_get_product_id();
	char ver[24]={0} ;
		
	switch (pi){
	case Project_GUA:
		strncpy(ver, "GUA",3);
		ver[3]='\0';
		break;
	case Project_BMB:
		strncpy(ver, "BMB",3);
		ver[3]='\0';
		break;

	case Project_TAP:
		strncpy(ver, "TAP",3);
		ver[3]='\0';
		break;
		
    case Project_MES:
		strncpy(ver, "MES",3);
		ver[3]='\0';
		break;
		
/* MTD-BSP-VT-HWID-01+[ */
    case Project_JLO:
		strncpy(ver, "JLO",3);
		ver[3]='\0';
		break;
/* MTD-BSP-VT-HWID-01+] */

	default:
		strncpy(ver, "Unkonwn Device Model",20);
		ver[20]='\0';
		break;
	}

	len = snprintf(page, count, "%s\n",
		ver);  /* MTD-BSP-VT-PROC-00* */
		
	return proc_calc_metrics(page, start, off, count, eof, len);	
}
开发者ID:NoelMacwan,项目名称:SXDMesona,代码行数:45,代码来源:fih_proc_fs.c

示例6: model_number_read_proc

static int model_number_read_proc(char *page, char **start, off_t off,
                             int count, int *eof, void *data)
{
    int len;
    int pi1 = fih_get_sim_id();
    int pi2 = fih_get_band_id();
    char ver[15]= {0};

    switch (pi1) {
    case SINGLE_SIM:
        switch(pi2) {
        case BAND_18:
           strncpy(ver, "C1905",5);
           ver[5]='\0';
           break;
        case BAND_18_INDIA:
        case BAND_1245:
           strncpy(ver, "C1904", 5);
           ver[5]='\0';
           break;
    }
    break;
    case DUAL_SIM:
        switch(pi2) {
        case BAND_18:
           strncpy(ver, "C2005",5);
           ver[5]='\0';
           break;
        case BAND_18_INDIA:
        case BAND_1245:
           strncpy(ver, "C2004", 5);
           ver[5]='\0';
           break;
    }
    break;
    default:
        strncpy(ver, "Unkonwn Model",13);
        ver[13]='\0';
        break;
    }

    len = snprintf(page, count, "%s\n", ver);

    return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:blackdeviant,项目名称:hybrid-nicki,代码行数:45,代码来源:fih_proc_fs.c

示例7: uptime_read_proc

static int uptime_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	struct timespec uptime;
	struct timespec idle;
	int len;
	cputime_t idletime = cputime_add(init_task.utime, init_task.stime);

	do_posix_clock_monotonic_gettime(&uptime);
	cputime_to_timespec(idletime, &idle);
	len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
			(unsigned long) uptime.tv_sec,
			(uptime.tv_nsec / (NSEC_PER_SEC / 100)),
			(unsigned long) idle.tv_sec,
			(idle.tv_nsec / (NSEC_PER_SEC / 100)));

	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:18,代码来源:proc_misc.c

示例8: reboot_info_read_proc

/* MTD-BSP-VT-RECOVERY-00*[ */
static int reboot_info_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
{
    int len;
    char ver[10]= {0};
    unsigned int boot_info = get_boot_info();

    if (boot_info == 0x77665502) {
        strncpy( ver, "recovery", 8);
        ver[8]='\0';
    } else {
        strncpy( ver, "normal", 6);
        ver[6]='\0';
    }
    len = snprintf(page, count, "%s\n",ver); /* MTD-BSP-VT-PROC-00* */

    return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:1n,项目名称:xperia-m-source,代码行数:19,代码来源:fih_proc_fs.c

示例9: support_sensor_read

static int support_sensor_read(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	int project_id = fih_get_product_id();
	int phase_id = fih_get_product_phase(); //Div2D5-OwenHuang-FB0_Sensor_Proc_Read-01+
	int project_sensor = 0;
		
	switch (project_id){
	case Product_FB0:
		project_sensor = DEFAULT_SUPPORT_SENSOR;
		break;
	case Product_FD1:
		project_sensor = DEFAULT_SUPPORT_SENSOR;
		break;
	case Product_SF3:
		project_sensor = DEFAULT_SUPPORT_SENSOR;
		break;
	case Product_SF5:
		//Div2D5-OwenHuang-FB0_Sensor_Proc_Read-01+{
		if (phase_id == Product_PR1)
			project_sensor = BIT_ECOMPASS | BIT_GSENSOR | BIT_LIGHT; //not support proximity sensor at PR1 stage
		else
			project_sensor = DEFAULT_SUPPORT_SENSOR;
		//Div2D5-OwenHuang-FB0_Sensor_Proc_Read-01+}
		break;
	case Product_SF6:
		project_sensor = DEFAULT_SUPPORT_SENSOR; //DIV5-BSP-CH-SF6-SENSOR-PORTING04++
		break;
	case Product_SF8:
		project_sensor = DEFAULT_SUPPORT_SENSOR;
		break;
	default:
		project_sensor = DEFAULT_SUPPORT_SENSOR;
		break;
	}

	len = snprintf(page, PAGE_SIZE, "%d\n", project_sensor);
		
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:BSydz,项目名称:abenagiel-android_kernel_fih_msm7x30,代码行数:41,代码来源:fxx_info.c

示例10: device_model_read_proc

static int device_model_read_proc(char *page, char **start, off_t off,
                                  int count, int *eof, void *data)
{
    int len;
    int pi = fih_get_product_id();
    char ver[24]= {0} ;

    switch (pi) {
    case PROJECT_S3A:
        strncpy(ver, "S3A",3);
        ver[3]='\0';
        break;
    default:
        strncpy(ver, "Unkonwn Device Model",20);
        ver[20]='\0';
        break;
    }

    len = snprintf(page, count, "%s\n",
                   ver);  /* MTD-BSP-VT-PROC-00* */

    return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:1n,项目名称:xperia-m-source,代码行数:23,代码来源:fih_proc_fs.c

示例11: baseband_read_proc

static int baseband_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;

	int pp = fih_get_product_phase();
	char ver[24];
	
	switch (pp){
	case Product_PR1:
		strcpy(ver, "PR1");
		break; 
	case Product_PR2:
		strcpy(ver, "PR2");
		break; 
	case Product_PR2p5:
		strcpy(ver, "PR2p5");
		break; 
	case Product_PR230:
		strcpy(ver, "PR230");
		break; 
	case Product_PR231:
		if (fih_get_product_id() == Product_FD1) //Div2-SW2-BSP, JOE HSU,FD1 PR235 = FB0 PR231
				strcpy(ver, "PR235");
			else
		    strcpy(ver, "PR231");
		break; 
	case Product_PR232:
		strcpy(ver, "PR232");
		break; 
	case Product_PR3:
		strcpy(ver, "PR3");
		break;
  //Div252-AC-HARDWARE_ID_01+{
	case Product_PR1p5:
		strcpy(ver, "PR15");
		break; 
  //Div252-AC-HARDWARE_ID_01+}
	case Product_PR4:
		strcpy(ver, "PR4");
		break;
	case Product_PR5:
		strcpy(ver, "PR5");
		break;  
	case Product_PCR:
		strcpy(ver, "PCR");
		break;
	case Product_MP1:
		strcpy(ver, "MP1");
		break;				
	case Product_EVB:
		strcpy(ver, "EVB");
		break; 
	default:
		strcpy(ver, "Unkonwn Baseband version");
		break;
	}

	len = snprintf(page, PAGE_SIZE, "%s\n",
		ver);

	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:BSydz,项目名称:abenagiel-android_kernel_fih_msm7x30,代码行数:63,代码来源:fxx_info.c

示例12: memory_read_proc

static int memory_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len = get_mem_list(page);
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:6,代码来源:proc_misc.c

示例13: swaps_read_proc

static int swaps_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len = get_swaparea_info(page);
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:6,代码来源:proc_misc.c

示例14: execdomains_read_proc

static int execdomains_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len = get_exec_domain_list(page);
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:6,代码来源:proc_misc.c

示例15: ds1286_read_proc

static int ds1286_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len = get_ds1286_status(page);
	return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:6,代码来源:proc_misc.c


注:本文中的proc_calc_metrics函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。