From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbdFEKdW (ORCPT ); Mon, 5 Jun 2017 06:33:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49468 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbdFEKdV (ORCPT ); Mon, 5 Jun 2017 06:33:21 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A5C4A85542 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A5C4A85542 Date: Mon, 5 Jun 2017 12:33:17 +0200 From: Jiri Olsa To: Andi Kleen Cc: peterz@infradead.org, acme@kernel.org, eranian@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 6/6] perf, tools: Add test cases for new data source encoding Message-ID: <20170605103317.GA28871@krava> References: <20170602201233.19490-1-andi@firstfloor.org> <20170602201233.19490-6-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170602201233.19490-6-andi@firstfloor.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 05 Jun 2017 10:33:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2017 at 01:12:33PM -0700, Andi Kleen wrote: SNIP > + n += perf_mem__lvl_scnprintf(out + n, sizeof out - n, &mi); > + snprintf(failure, sizeof failure, "unexpected %s", out); > + TEST_ASSERT_VAL(failure, !strcmp(string, out)); > + return 0; > +} > + > +int test__mem(int subtest __maybe_unused) > +{ > + int ret = 0; > + > + ret |= check(((union perf_mem_data_src) { > + .mem_lvl = PERF_MEM_LVL_HIT, > + .mem_lvlx = PERF_MEM_LVLX_L4 }), "N/AL4 hit"); > + > + ret |= check(((union perf_mem_data_src) { > + .mem_lvl = PERF_MEM_LVL_MISS, > + .mem_lvlx = PERF_MEM_LVLX_PMEM }), "N/APMEM miss"); > + > + ret |= check(((union perf_mem_data_src) { > + .mem_snoopx = PERF_MEM_SNOOPX_FWD, > + .mem_lvl = PERF_MEM_LVL_MISS, > + .mem_lvlx = PERF_MEM_LVLX_RAM }), "ForwardRAM miss"); [jolsa@krava perf]$ ./perf test source -v 5: Test data source output : --- start --- test child forked, pid 8689 FAILED tests/mem.c:20 unexpected FwdRAM miss test child finished with -1 ---- end ---- Test data source output: FAILED! jirka