• Home
  • Raw
  • Download

Lines Matching refs:dp

59 static int dtop_format_dp_names(struct dtop_data_point *dp, const char  in dtop_format_dp_names()  argument
62 if (dp->prefix) { in dtop_format_dp_names()
63 if (fprintf(fw, "\"%s:%s:%s\",", prefix, dp->prefix, in dtop_format_dp_names()
64 dp->name) < 0) in dtop_format_dp_names()
67 if (fprintf(fw, "\"%s::%s\",", prefix, dp->name) < 0) in dtop_format_dp_names()
84 static int dtop_format_dp_values(struct dtop_data_point *dp, FILE *fw) in dtop_format_dp_values() argument
86 switch (dp->type) { in dtop_format_dp_values()
88 if (fprintf(fw, "%"PRIu64, dp->data.d_ulong) < 0) in dtop_format_dp_values()
92 if (fprintf(fw, "%"PRId64, dp->data.d_long) < 0) in dtop_format_dp_values()
96 if (fprintf(fw, "%d", dp->data.d_uint) < 0) in dtop_format_dp_values()
100 if (fprintf(fw, "%u", dp->data.d_uint) < 0) in dtop_format_dp_values()
104 if (fprintf(fw, "%c,", dp->data.d_uchar) < 0) in dtop_format_dp_values()
106 if (fprintf(fw, "(0x%02X)", dp->data.d_uchar) < 0) in dtop_format_dp_values()
110 if (fprintf(fw, "%c,", dp->data.d_char) < 0) in dtop_format_dp_values()
112 if (fprintf(fw, "(%d)", dp->data.d_char) < 0) in dtop_format_dp_values()
116 if (fprintf(fw, "\"%s\"", dp->data.d_str) < 0) in dtop_format_dp_values()
134 (struct dtop_data_point_gatherer *dpset, struct dtop_data_point dp) in dtop_format_text_for_snapshot() argument
137 if (dp.prefix) in dtop_format_text_for_snapshot()
138 printf("%s:", dp.prefix); in dtop_format_text_for_snapshot()
140 printf("%s::", dp.name); in dtop_format_text_for_snapshot()
151 static int dtop_print_dp_csv(struct dtop_data_point *dp, FILE *fw) in dtop_print_dp_csv() argument
153 if (dtop_format_dp_values(dp, fw) == FILE_ERROR) in dtop_print_dp_csv()
166 static void dtop_print_dp(struct dtop_data_point *dp, const char *prefix) in dtop_print_dp() argument
168 dtop_format_dp_names(dp, prefix, stdout); in dtop_print_dp()
170 dtop_format_dp_values(dp, stdout); in dtop_print_dp()
183 struct dtop_data_point_gatherer *dpset, struct dtop_data_point dp) in dtop_handle_dp_type_for_snapshot() argument
187 switch (dp.type) { in dtop_handle_dp_type_for_snapshot()
191 int64 = (int64_t)dp.data.d_ulong in dtop_handle_dp_type_for_snapshot()
192 - (int64_t)dp.initial_data.d_ulong; in dtop_handle_dp_type_for_snapshot()
194 dtop_format_text_for_snapshot(dpset, dp); in dtop_handle_dp_type_for_snapshot()
201 int64 = (int64_t)dp.data.d_long in dtop_handle_dp_type_for_snapshot()
202 - (int64_t)dp.initial_data.d_long; in dtop_handle_dp_type_for_snapshot()
204 dtop_format_text_for_snapshot(dpset, dp); in dtop_handle_dp_type_for_snapshot()
210 int64 = (int64_t)dp.data.d_uint in dtop_handle_dp_type_for_snapshot()
211 - (int64_t)dp.initial_data.d_uint; in dtop_handle_dp_type_for_snapshot()
213 dtop_format_text_for_snapshot(dpset, dp); in dtop_handle_dp_type_for_snapshot()
219 int64 = (int64_t)dp.data.d_int in dtop_handle_dp_type_for_snapshot()
220 - (int64_t)dp.initial_data.d_int; in dtop_handle_dp_type_for_snapshot()
222 dtop_format_text_for_snapshot(dpset, dp); in dtop_handle_dp_type_for_snapshot()
316 void dtop_store_dp(struct dtop_data_point *dp, const char *str) in dtop_store_dp() argument
318 switch (dp->type) { in dtop_store_dp()
320 sscanf(str, "%"PRIu64, &(dp->data.d_ulong)); in dtop_store_dp()
321 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
322 dp->initial_data.d_ulong = dp->data.d_ulong; in dtop_store_dp()
323 dp->initial_data_populated = POPULATED; in dtop_store_dp()
327 sscanf(str, "%"PRId64, &(dp->data.d_long)); in dtop_store_dp()
328 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
329 dp->initial_data.d_long = dp->data.d_long; in dtop_store_dp()
330 dp->initial_data_populated = POPULATED; in dtop_store_dp()
334 sscanf(str, "%u", &(dp->data.d_uint)); in dtop_store_dp()
335 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
336 dp->initial_data.d_uint = dp->data.d_uint; in dtop_store_dp()
337 dp->initial_data_populated = POPULATED; in dtop_store_dp()
341 sscanf(str, "%d", &(dp->data.d_int)); in dtop_store_dp()
342 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
343 dp->initial_data.d_int = dp->data.d_int; in dtop_store_dp()
344 dp->initial_data_populated = POPULATED; in dtop_store_dp()
348 sscanf(str, "%c", &(dp->data.d_uchar)); in dtop_store_dp()
349 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
350 dp->initial_data.d_uchar = dp->data.d_uchar; in dtop_store_dp()
351 dp->initial_data_populated = POPULATED; in dtop_store_dp()
355 sscanf(str, "%c", &(dp->data.d_char)); in dtop_store_dp()
356 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
357 dp->initial_data.d_char = dp->data.d_char; in dtop_store_dp()
358 dp->initial_data_populated = POPULATED; in dtop_store_dp()
362 sscanf(str, "%s", dp->data.d_str); in dtop_store_dp()
363 if (dp->initial_data_populated == NOT_POPULATED) { in dtop_store_dp()
364 memcpy(dp->initial_data.d_str, dp->data.d_str, in dtop_store_dp()
366 dp->initial_data_populated = POPULATED; in dtop_store_dp()