Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1289597ybg; Tue, 2 Jun 2020 06:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/gb0OOdyOkq6sNrcPZpxM4l1iC5TsCfWDbHLageeJCwDWVnhaWlxDqUCrHUQA402t5Z08 X-Received: by 2002:aa7:d613:: with SMTP id c19mr13580075edr.321.1591103994708; Tue, 02 Jun 2020 06:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591103994; cv=none; d=google.com; s=arc-20160816; b=Eo27s34+FcgWdcmtU07pCMk+SKPCotSq8gdXKugFwhsnQWYToCDOWtpPNoyDWf/9R2 j7x06G8zXeXcNIyCZszbrNJNwK97SfQz446um9+Lsij3504OFUMvTCb+Tm9jklBqs1MP t64Ciw2eUxEqMc8OJxVVkqfV8tOq6lalm8Kgq777nxlE2uxdxPOViB/hUNV95YGH2tgc Q/duLYcGb/mFWY/QUOP2B5W4YN/fl/o2A/qTs56T07v3i2dyM4eMh6QVBO3RSGMbBRQn CLHNIq1YLYgtVfWxrn6RvSPqfxBJPdvaFtc1ZYtqSI5g8gKoyigZ3+B1t/4JT1SIgWkV KUyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=P84mRIQzKrwCVq5uxgHNtZN8HW/b5hkyeS6yj/UbW4A=; b=MZwTbmXoA4233kA0aaNh2tWkRxlikUWfJZTzDmtK18GOqvAhzTrPLQ85FRvr+oE01h 7StYb5eEyks6P1hQx1gduNflAl0OKwVqp3C1D12jK6/t6pi6F9GWBibaytzq91D4S8km P92+vlgetMgNR8cxMYiNuW021OqC5XAfCGhORrJUql7KC+I5Q0JIdPRm5SQdq+jFUMnR +if2Ib91rhxgz9Y4pRCSYoUwWimhnYPfXvqvgPGQUnH7Ipd5rqis/6xDKuKbRQsZ1jNp pY51wntPqwN/BjtJcBmZZPYVhV7LOQW6qKUvva73fsSpmg3HPun/U2euOhTUCICYsatt IqEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=k8pfcQVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a63si1636574edf.135.2020.06.02.06.19.30; Tue, 02 Jun 2020 06:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=k8pfcQVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgFBNQp (ORCPT + 99 others); Tue, 2 Jun 2020 09:16:45 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:40667 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbgFBNQl (ORCPT ); Tue, 2 Jun 2020 09:16:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591103800; x=1622639800; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=P84mRIQzKrwCVq5uxgHNtZN8HW/b5hkyeS6yj/UbW4A=; b=k8pfcQVKaxynOmaWqzv8axHToGYYcNBDiheOf/aYGc6vm1TK31tty3DV vDhLmY7688VfbLKLf2UtPLSpqbvAt9kgqEbly0CmKc4R8AT83uhCi8KuD n+aJYPxS0WhEgCsvXxlC6mmWTBaAhcbHT4j19iAfOTytnTtkRYM/ecWml s=; IronPort-SDR: wi30j8U1jqV8InCQm0WcaBes5KBTq5/SBXhs4jATm1wktr0yLfUco/6IsfHVHfQiyciRKLRswq H/UL2SrbmKpA== X-IronPort-AV: E=Sophos;i="5.73,464,1583193600"; d="scan'208";a="34015768" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-4e7c8266.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 02 Jun 2020 13:16:24 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-4e7c8266.us-west-2.amazon.com (Postfix) with ESMTPS id 4B5F4A06A9; Tue, 2 Jun 2020 13:16:21 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Jun 2020 13:16:20 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.161.253) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Jun 2020 13:16:04 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v14 13/15] mm/damon-test: Add a kunit test for recording setup Date: Tue, 2 Jun 2020 15:15:49 +0200 Message-ID: <20200602131549.23617-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200602130125.20467-1-sjpark@amazon.com> References: <20200602130125.20467-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.253] X-ClientProxiedBy: EX13D41UWC001.ant.amazon.com (10.43.162.107) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This commit adds another unit test case for the recording setup. Signed-off-by: SeongJae Park --- mm/damon-test.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/damon-test.h b/mm/damon-test.h index cf715529ff64..5b18619efe72 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -137,6 +137,18 @@ static void damon_test_set_pids(struct kunit *test) KUNIT_EXPECT_STREQ(test, (char *)buf, "\n"); } +static void damon_test_set_recording(struct kunit *test) +{ + struct damon_ctx *ctx = &damon_user_ctx; + + damon_set_recording(ctx, 4242, "foo.bar"); + KUNIT_EXPECT_EQ(test, ctx->rbuf_len, 4242u); + KUNIT_EXPECT_STREQ(test, ctx->rfile_path, "foo.bar"); + damon_set_recording(ctx, 42, "foo"); + KUNIT_EXPECT_EQ(test, ctx->rbuf_len, 42u); + KUNIT_EXPECT_STREQ(test, ctx->rfile_path, "foo"); +} + /* * Test damon_three_regions_in_vmas() function * @@ -596,6 +608,7 @@ static struct kunit_case damon_test_cases[] = { KUNIT_CASE(damon_test_tasks), KUNIT_CASE(damon_test_regions), KUNIT_CASE(damon_test_set_pids), + KUNIT_CASE(damon_test_set_recording), KUNIT_CASE(damon_test_three_regions_in_vmas), KUNIT_CASE(damon_test_aggregate), KUNIT_CASE(damon_test_write_rbuf), -- 2.17.1