return NULL;
while (*clist != NULL) {
+
c = *clist;
if ((i = strcmp(c->name, name)) == 0) {
/* cifs found in list */
return (NULL);
while (persist_names[++i]) {
+
/* Get absolute path for current persistent name */
link = get_persistent_name_path(persist_names[i]);
if (!link)
while ((fgets(line, INTERRUPTS_LINE + 11 * cpu_nr , fp) != NULL) &&
(irq < max_nr_irqcpu)) {
+
p = strcspn(line, ":");
if ((p > 0) && (p < 16)) {
irq++;
* the number of lines...
*/
while (fgets(line, sizeof(line), fp) != NULL) {
+
if (!count_part) {
i = sscanf(line, "%*d %*d %s %lu %*u %*u %*u %lu",
dev_name, &rd_ios, &wr_ios);
}
while (val > 0) {
+
*--p = syms[j = val % radix];
val /= radix;
if (nozero && (j == 0)) {
return NULL;
while (*dlist != NULL) {
+
d = *dlist;
if ((i = strcmp(d->name, name)) == 0) {
/* Device found in list */
int j;
while (c < last) {
+
st_irq_i = st_irq[curr] + c + 1;
st_irq_j = st_irq[!curr] + c + 1;
st_irq_i->irq_nr = st_irq_j->irq_nr;
* Parse header line to see which CPUs are online
*/
while (fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) {
+
next = line;
while (((cp = strstr(next, "CPU")) != NULL) && (index < cpu_nr)) {
+
cpu = strtol(cp + 3, &next, 10);
if (cpu >= cpu_nr)
break;
/* Create instance for each interrupt for the current CPU */
while (list != NULL) {
+
snprintf(buf, sizeof(buf), "%s::cpu%d", list->item_name, cpu);
buf[sizeof(buf) - 1] = '\0';
/* Create instances and metrics for each interrupts for CPU "all" */
while (list != NULL) {
+
if (!strcmp(list->item_name, K_LOWERSUM)) {
/*
* Create metric for interrupt "sum" for CPU "all".
struct st_pid *p;
while (*plist != NULL) {
+
p = *plist;
if (!p->exist || force) {
*plist = p->next;
* other TIDs.
*/
while (*plist != NULL) {
+
p = *plist;
if (!p->tgid && (p->pid == pid))
/* PID found in list */
* following its TGID.
*/
while (*plist != NULL) {
+
p = *plist;
if (p->pid == tgid) {
/* TGID found in list */
plist = &(p->next);
while (*plist != NULL) {
+
p = *plist;
if ((p->tgid == tgid_p) && (p->pid == pid))
/* TID found in list */
return 1;
while ((state < 3) && (fgets(line, sizeof(line), fp) != NULL)) {
+
switch (state) {
case 0:
if (strstr(line, "[stack]")) {
return;
while ((drp = __readdir(dir)) != NULL) {
+
if (!isdigit(drp->d_name[0])) {
continue;
}
/* Get directory entries */
while ((drp = __readdir(dir)) != NULL) {
+
if (!isdigit(drp->d_name[0])) {
continue;
}
memset(st_pwr_fan, 0, STATS_PWR_FAN_SIZE);
while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
i = 0;
while ((feature = sensors_get_features(chip, &i))) {
+
if (feature->type == SENSORS_FEATURE_FAN) {
j = 0;
if (fan_read + 1 > nr_alloc)
sensors_snprintf_chip_name(st_pwr_fan_i->device, MAX_SENSORS_DEV_LEN, chip);
while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
if ((sub->type == SENSORS_SUBFEATURE_FAN_INPUT) &&
(sub->flags & SENSORS_MODE_R)) {
if (sensors_get_value(chip, sub->number, &st_pwr_fan_i->rpm)) {
memset(st_pwr_temp, 0, STATS_PWR_TEMP_SIZE);
while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
i = 0;
while ((feature = sensors_get_features(chip, &i))) {
+
if (feature->type == SENSORS_FEATURE_TEMP) {
j = 0;
if (temp_read + 1 > nr_alloc)
sensors_snprintf_chip_name(st_pwr_temp_i->device, MAX_SENSORS_DEV_LEN, chip);
while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
if ((sub->type == SENSORS_SUBFEATURE_TEMP_INPUT) &&
(sub->flags & SENSORS_MODE_R)) {
if (sensors_get_value(chip, sub->number, &st_pwr_temp_i->temp)) {
memset(st_pwr_in, 0, STATS_PWR_IN_SIZE);
while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
i = 0;
while ((feature = sensors_get_features(chip, &i))) {
+
if (feature->type == SENSORS_FEATURE_IN) {
j = 0;
if (in_read + 1 > nr_alloc)
sensors_snprintf_chip_name(st_pwr_in_i->device, MAX_SENSORS_DEV_LEN, chip);
while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
if ((sub->type == SENSORS_SUBFEATURE_IN_INPUT) &&
(sub->flags & SENSORS_MODE_R)) {
if (sensors_get_value(chip, sub->number, &st_pwr_in_i->in)) {
int i;
while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
i = 0;
while ((feature = sensors_get_features(chip, &i))) {
+
if (feature->type == type) {
count++;
}
* Parse header line to see which CPUs are online
*/
while (fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) {
+
next = line;
while (((cp = strstr(next, "CPU")) != NULL) && (index < cpu_nr)) {
cpu = strtol(cp + 3, &next, 10);
+
if (cpu + 2 > nr_alloc) {
rc = -1;
goto out;
len = strlen(str);
while (i < len - 3) {
+
if ((str[i] == '\\') &&
(str[i + 1] >= '0') && (str[i + 1] <= '3') &&
(str[i + 2] >= '0') && (str[i + 2] <= '7') &&
char *buffer = (char *) buf;
while (nr_bytes > 0) {
+
block = write(fd, &buffer[offset], nr_bytes);
if (block < 0) {
return 0;
while ((entry = readdir(dir)) != NULL) {
+
if (regexec(&tape_reg, &entry->d_name[0], 1, &match, 0) == 0) {
/* d_name[2] to skip the st at the front */
tmp = atoi(&entry->d_name[2]) + 1;