Lines Matching full:tz
57 struct tz {
66 struct tz *tz;
105 config_setting_t *tz;
127 tz = config_lookup(&cfg, "thermal-zones");
128 if (!tz) {
133 length = config_setting_length(tz);
143 node = config_setting_get_elem(tz, i);
262 struct tz *tz;
272 tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1));
273 if (!tz) {
274 ERROR("Failed to allocate thermometer->tz\n");
278 thermometer->tz = tz;
279 thermometer->tz[thermometer->nr_tz].fd_temp = fd;
280 thermometer->tz[thermometer->nr_tz].name = strdup(name);
281 thermometer->tz[thermometer->nr_tz].polling = polling;
344 struct tz *tz = arg;
347 pread(tz->fd_temp, buf, sizeof(buf), 0);
349 fprintf(tz->file_out, "%ld %s", getuptimeofday_ms(), buf);
374 thermometer->tz[i].name, options->postfix);
387 fprintf(f, "timestamp(ms) %s(°mC)\n", thermometer->tz[i].name);
389 thermometer->tz[i].file_out = f;
391 DEBUG("Created '%s' file for thermal zone '%s'\n", path, thermometer->tz[i].name);
396 thermometer->tz[i].fd_timer = timerfd_create(CLOCK_MONOTONIC, 0);
397 if (thermometer->tz[i].fd_timer < 0) {
399 thermometer->tz[i].name);
404 thermometer->tz[i].name, thermometer->tz[i].polling);
407 msec_to_timespec(thermometer->tz[i].polling);
409 if (timerfd_settime(thermometer->tz[i].fd_timer, 0,
413 if (mainloop_add(thermometer->tz[i].fd_timer,
415 &thermometer->tz[i]))
528 fclose(thermometer->tz[i].file_out);