MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cv2_profile

Function cv2_profile

src/mcp/test_impact_coverage.c:979–1003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979static bool cv2_profile(cv2_context_t *ctx, cv2_span_t fields[4], int index) {
980 uint64_t id, counters;
981 cbm_coverage_profile_t *row = &ctx->map->profiles[index];
982 if (!cv2_decimal(ctx, fields[0], true, &id))
983 return false;
984 if (id != (uint64_t)index)
985 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
986 row->id = index;
987 if (!cv2_hex64(ctx, fields[2], &row->function_hash) ||
988 !cv2_decimal(ctx, fields[3], true, &counters))
989 return false;
990 if (!counters)
991 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
992 row->counter_count = counters;
993 if (!cv2_name(ctx, fields[1], row))
994 return false;
995 if (index) {
996 int order;
997 if (!cv2_profile_compare(ctx, row - 1, row, &order))
998 return false;
999 if (order >= 0)
1000 return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT);
1001 }
1002 return true;
1003}
1004
1005static bool cv2_profiles(cv2_context_t *ctx, cv2_span_t profiles) {
1006 size_t position = ctx->profile_start;

Callers 1

cv2_profilesFunction · 0.85

Calls 5

cv2_decimalFunction · 0.85
cv2_failFunction · 0.85
cv2_hex64Function · 0.85
cv2_nameFunction · 0.85
cv2_profile_compareFunction · 0.85

Tested by

no test coverage detected