/** Handle moment in which endpoint is deleted */ void ep_destroy(struct spi_ep *ep) { struct spi_source *source = ep->source; struct spi_stats *stats = &(source->spi->stats); /* a testing endpoint: update performance metrics */ if (source->testing && ep->predictions > 0) { stats->test_all++; stats->test_all_signs += ep->predictions; stats->test_is[source->label]++; stats->test_signs[source->label] += ep->predictions; if (ep->verdict == 0) ep->verdict = SPI_LABEL_UNKNOWN; if (ep->verdict == source->label) { stats->test_ok++; stats->test_ok_signs += ep->predictions; } else { stats->test_FN[source->label]++; stats->test_FP[ep->verdict]++; dbg(1, "%s: %s is %d but classified as %d\n", spi_src2a(ep->source), spi_epa2a(ep->epa), source->label, ep->verdict); } } mmatic_destroy(ep->mm); }
static void cleanup() { lfc_deinit(fd->lfc); thash_free(fd->out_files); mmatic_destroy(fd->mm); }