本文整理汇总了C++中proc_calc_metrics函数的典型用法代码示例。如果您正苦于以下问题:C++ proc_calc_metrics函数的具体用法?C++ proc_calc_metrics怎么用?C++ proc_calc_metrics使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了proc_calc_metrics函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: app_version_read_proc
static int app_version_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len;
// char *ker_ver = "HUAWEI_KERNEL_VERSION";
char *ker_ver = HUAWEI_KERNEL_VERSION;
char *lcd_name = NULL;
char * touch_info = NULL;
char *wifi_device_name = NULL;
char audio_property[AUDIO_PROPERTY_LEN] = {0};
/*print sensor info into app_info*/
/*< DTS2012032003522 zengxiangguang 20120320 begin */
/* Array **_**_id must be large enough to hold both id and sub id */
/* 'cause the following code would call strcat function to connect */
/* sub id to array **_**_id[] */
char s_board_id[BOARD_ID_LEN + BOARD_ID_SUB_VER_LEN] = {0};
char sub_ver[BOARD_ID_SUB_VER_LEN] = {0};
char hw_version_id[HW_VERSION + HW_VERSION_SUB_VER] = {0};
char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};
/* DTS2012032003522 zengxiangguang 20120320 end >*/
char *compass_gs_name = NULL;
char *sensors_list_name = NULL;
set_s_board_hw_version(s_board_id,hw_version_id);
sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
strcat(s_board_id, sub_ver);
strcat(hw_version_id, hw_version_sub_ver);
set_s_board_hw_version_special(hw_version_id,hw_version_sub_ver,s_board_id,sub_ver);
compass_gs_name=get_compass_gs_position_name();
sensors_list_name = get_sensors_list_name();
lcd_name = get_lcd_panel_name();
wifi_device_name = get_wifi_device_name();
get_audio_property(audio_property);
touch_info = get_touch_info();
if (touch_info == NULL)
{
touch_info = "Unknow touch";
}
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
charge_flag = get_charge_flag();
len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
"%s\n"
"KERNEL_VER:\n"
"%s\n"
"FLASH_ID:\n"
"%s\n"
"board_id:\n%s\n"
"lcd_id:\n%s\n"
"cam_id:\n%d\n"
"ts_id:\n%d\n"
"charge_flag:\n%d\n"
"compass_gs_position:\n%s\n"
"sensors_list:\n%s\n"
"hw_version:\n%s\n"
"wifi_chip:\n%s\n"
"audio_property:\n%s\n"
"touch_info:\n%s\n",
appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name,sensors_list_name, hw_version_id,wifi_device_name,audio_property, touch_info);
#else
len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
"%s\n"
"KERNEL_VER:\n"
"%s\n"
"FLASH_ID:\n"
"%s\n"
"board_id:\n%s\n"
"lcd_id:\n%s\n"
"cam_id:\n%d\n"
"ts_id:\n%d\n"
"compass_gs_position:\n%s\n"
"sensors_list:\n%s\n"
"hw_version:\n%s\n"
"audio_property:\n%s\n"
"touch_info:\n%s\n",
appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name,sensors_list_name, hw_version_id,audio_property, touch_info);
#endif
return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:markcn,项目名称:kernel_huawei_c8812,代码行数:80,代码来源:app_info.c
示例17: app_version_read_proc
//.........这里部分代码省略.........
int len;
char *ker_ver = HUAWEI_KERNEL_VERSION;
char *lcd_name = NULL;
char s_board_id[BOARD_ID_LEN] = {0};
char sub_ver[SUB_VER_LEN] = {0};
char hw_version_id[HW_VERSION] = {0};
char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};
char *compass_gs_name = NULL;
char *wifi_name = NULL;
switch(machine_arch_type)
{
case MACH_TYPE_MSM7X27_U8510:
strcpy(s_board_id, "MSM7X27_U8510");
break;
case MACH_TYPE_MSM7X27_U8510_1:
strcpy(s_board_id, "MSM7X27_U8510_1");
break;
case MACH_TYPE_MSM7X27_M650:
strcpy(s_board_id, "MSM7X27_M650");
break;
case MACH_TYPE_MSM7X27_C8800:
strcpy(s_board_id, "MSM7X27_C8800");
break;
case MACH_TYPE_MSM7X27_U8650:
strcpy(s_board_id, "MSM7X27_U8650");
break;
case MACH_TYPE_MSM7X27_M865:
strcpy(s_board_id, "MSM7X27_M865");
break;
case MACH_TYPE_MSM7X27_C8650:
strcpy(s_board_id, "MSM7X27_C8650");
break;
default:
strcpy(s_board_id, "ERROR");
break;
}
sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
strcat(s_board_id, sub_ver);
strcat(hw_version_id, hw_version_sub_ver);
lcd_name = get_lcd_panel_name();
compass_gs_name=get_compass_gs_position_name();
wifi_name = get_wifi_device_name();
#ifdef CONFIG_HUAWEI_KERNEL
memset(str_flash_nand_id,0,PROC_MANUFACTURER_STR_LEN);
get_flash_id(str_flash_nand_id,PROC_MANUFACTURER_STR_LEN);
#endif
/* write the power down charge flag to the file /proc/app_info,
* so we can read the flag in recovery mode to decide we enter
* the recovery mode or power down charge movie
*/
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
charge_flag = get_charge_flag();
len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
"%s\n"
"KERNEL_VER:\n"
"%s\n"
"FLASH_ID:\n"
"%s\n"
"board_id:\n%s\n"
"lcd_id:\n%s\n"
"cam_id:\n%d\n"
"ts_id:\n%d\n"
"hw_version:\n%s\n"
"charge_flag:\n%d\n"
"compass_gs_position:\n%s\n"
"wifi_name:\n%s\n",
appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, hw_version_id, charge_flag,compass_gs_name,wifi_name);
#else
len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
"%s\n"
"KERNEL_VER:\n"
"%s\n"
"FLASH_ID:\n"
"%s\n"
"board_id:\n%s\n"
"lcd_id:\n%s\n"
"cam_id:\n%d\n"
"ts_id:\n%d\n"
"hw_version:\n%s\n"
"compass_gs_position:\n%s\n"
"wifi_name:\n%s\n",
appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, hw_version_id,compass_gs_name,wifi_name);
#endif
return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:Justin-G,项目名称:kernel_huawei_c8650,代码行数:101,代码来源:app_info.c
示例18: band_read_proc
static int band_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len;
int pi = fih_get_band_id();
char ver[40];
switch (pi)
{
case FIH_BAND_W1245:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_1245\n");
break;
case FIH_BAND_W1248:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_1248\n");
break;
case FIH_BAND_W125:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_125\n");
break;
case FIH_BAND_W128:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_128\n");
break;
case FIH_BAND_W25:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_25\n");
break;
case FIH_BAND_W18:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_18\n");
break;
case FIH_BAND_W15:
strcpy( ver, "GSM_BAND_1234, WCDMA_BAND_15\n");
break;
case FIH_BAND_C01:
strcpy( ver, "CDMA_BAND_01\n");
break;
case FIH_BAND_C0:
strcpy( ver, "CDMA_BAND_0\n");
break;
case FIH_BAND_C1:
strcpy( ver, "CDMA_BAND_1\n");
break;
case FIH_BAND_C01_AWS:
strcpy( ver, "CDMA_BAND_01F\n");
break;
case FIH_BAND_W1245_C01:
strcpy( ver, "GSM_BAND_1234, CDMA_BAND_01, WCDMA_BAND_1245\n");
break;
case FIH_BAND_W1245_G_850_1800_1900:
strcpy( ver, "GSM_BAND_134, WCDMA_BAND_1245\n");
break;
case FIH_BAND_W1248_G_900_1800_1900:
strcpy(ver, "GSM_BAND_234, WCDMA_BAND_1248\n");
break;
case FIH_BAND_W125_G_850_1800_1900:
strcpy( ver, "GSM_BAND_134, WCDMA_BAND_125\n");
break;
case FIH_BAND_W128_G_900_1800_1900:
strcpy( ver, "GSM_BAND_234, WCDMA_BAND_128\n");
break;
case FIH_BAND_W25_G_850_1800_1900:
strcpy( ver, "GSM_BAND_134, WCDMA_BAND_25\n");
break;
case FIH_BAND_W18_G_900_1800_1900:
strcpy( ver, "GSM_BAND_234, WCDMA_BAND_18\n");
break;
case FIH_BAND_W1_XI_G_900_1800_1900:
strcpy( ver, "GSM_BAND_234, WCDMA_BAND_1B\n");
break;
case FIH_BAND_W15_G_850_1800_1900:
strcpy( ver, "GSM_BAND_134, WCDMA_BAND_15\n");
break;
default:
strcpy( ver, "Unkonwn RF band id\n");
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,代码行数:78,代码来源:fxx_info.c
示例19: kstat_read_proc
static int kstat_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int i, len = 0;
extern unsigned long total_forks;
unsigned long jif = jiffies;
unsigned int sum = 0, user = 0, nice = 0, system = 0;
int major, disk;
for (i = 0 ; i < smp_num_cpus; i++) {
int cpu = cpu_logical_map(i), j;
user += kstat.per_cpu_user[cpu];
nice += kstat.per_cpu_nice[cpu];
system += kstat.per_cpu_system[cpu];
#if !defined(CONFIG_ARCH_S390)
for (j = 0 ; j < NR_IRQS ; j++)
sum += kstat.irqs[cpu][j];
#endif
}
proc_sprintf(page, &off, &len,
"cpu %u %u %u %lu\n", user, nice, system,
jif * smp_num_cpus - (user + nice + system));
for (i = 0 ; i < smp_num_cpus; i++)
proc_sprintf(page, &off, &len,
"cpu%d %u %u %u %lu\n",
i,
kstat.per_cpu_user[cpu_logical_map(i)],
kstat.per_cpu_nice[cpu_logical_map(i)],
kstat.per_cpu_system[cpu_logical_map(i)],
jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
+ kstat.per_cpu_nice[cpu_logical_map(i)] \
+ kstat.per_cpu_system[cpu_logical_map(i)]));
proc_sprintf(page, &off, &len,
"page %u %u\n"
"swap %u %u\n"
"intr %u",
kstat.pgpgin >> 1,
kstat.pgpgout >> 1,
kstat.pswpin,
kstat.pswpout,
sum
);
#if !defined(CONFIG_ARCH_S390) && !defined(CONFIG_ALPHA)
for (i = 0 ; i < NR_IRQS ; i++)
proc_sprintf(page, &off, &len,
" %u", kstat_irqs(i));
#endif
proc_sprintf(page, &off, &len, "\ndisk_io: ");
for (major = 0; major < DK_MAX_MAJOR; major++) {
for (disk = 0; disk < DK_MAX_DISK; disk++) {
int active = kstat.dk_drive[major][disk] +
kstat.dk_drive_rblk[major][disk] +
kstat.dk_drive_wblk[major][disk];
if (active)
proc_sprintf(page, &off, &len,
"(%u,%u):(%u,%u,%u,%u,%u) ",
major, disk,
kstat.dk_drive[major][disk],
kstat.dk_drive_rio[major][disk],
kstat.dk_drive_rblk[major][disk],
kstat.dk_drive_wio[major][disk],
kstat.dk_drive_wblk[major][disk]
);
}
}
proc_sprintf(page, &off, &len,
"\nctxt %u\n"
"btime %lu\n"
"processes %lu\n",
kstat.context_swtch,
xtime.tv_sec - jif / HZ,
total_forks);
return proc_calc_metrics(page, start, off, count, eof, len);
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:80,代码来源:proc_misc.c
示例20: cpu_read_number_proc
static int cpu_read_number_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len,unknow_flag=0;
int pp = fih_get_cpu_version_number();
char ver[24];
switch(pp)
{
case CPU_MSM8255_0_V1:
strcpy(ver, "CPU:MSM8255-0 V1");
break;
case CPU_MSM8655_0_V1:
strcpy(ver, "CPU:MSM8655-0 V1");
break;
case CPU_MSM8255_1_V1:
strcpy(ver, "CPU:MSM8255-1 V1");
break;
case CPU_MSM8655_1_V1:
strcpy(ver, "CPU:MSM8655-1 V1");
break;
case CPU_MSM8255_0_V2:
strcpy(ver, "CPU:MSM8255-0 V2");
break;
case CPU_MSM8655_0_V2:
strcpy(ver, "CPU:MSM8655-0 V2");
break;
case CPU_MSM8255_1_V2:
strcpy(ver, "CPU:MSM8255-1 V2");
break;
case CPU_MSM8655_1_V2:
strcpy(ver, "CPU:MSM8655-1 V2");
break;
case CPU_MSM8255_0_V2_12000MHz:
strcpy(ver, "CPU:MSM8255-0 1.2GHz V2");
break;
case CPU_MSM8655_0_V2_12000MHz:
strcpy(ver, "CPU:MSM8655-0 1.2GHz V2");
break;
case CPU_MSM8255_1_V2_12000MHz:
strcpy(ver, "CPU:MSM8255-1 1.2GHz V2");
break;
case CPU_MSM8655_1_V2_12000MHz:
strcpy(ver, "CPU:MSM8655-1 1.2GHz V2");
break;
case CPU_MSM8255_0_V2_14000MHz:
strcpy(ver, "CPU:MSM8255-0 1.4GHz V2");
break;
case CPU_MSM8655_0_V2_14000MHz:
strcpy(ver, "CPU:MSM8655-0 1.4GHz V2");
break;
default:
unknow_flag=1;
break;
}
if(unknow_flag)
{
len = snprintf(page, PAGE_SIZE, "%x\n",pp);
}
else
{
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,代码行数:65,代码来源:fxx_info.c
注:本文中的proc_calc_metrics函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论