Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1221316imm; Wed, 17 Oct 2018 15:47:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV63KhLDaDjipqLc5zkl0lTC7Jw/WzjoR/vtESe2AABoFJLGYfoEPZnfJcP+tfsHwX3LPrjWn X-Received: by 2002:a63:d502:: with SMTP id c2-v6mr26247357pgg.324.1539816463268; Wed, 17 Oct 2018 15:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539816463; cv=none; d=google.com; s=arc-20160816; b=iyCz/zc3Rzout49cMvgLsUbrg62PHk6N+HfgVQNFjBUZ5ax1u/z2493ufID89R4Fzb BzBXGAabghmiLVKz32FPWqnOHV1xm2G1sNykXsdNYK0Ou3N/R+wcsBFjlEIDGs1MDZwb bkjBC9EEjDxiif6MQsr9c0HtLhd16kXoA4qPdmGPmBJ2tDZ842KGt2x7yPzSxJVwkJl9 lfz9t0BvSxpzKXK3LQsV2VQ4nI3HnNqkeanSvwSh8vKX6xawJzt8gpQK0TXioBOiehdr 8bf5njOCXCKsaN9BKZ+2q0CKnKenN8C22+BIMxHPUTjjh7nZLmEYyD33VpmBurBKv8Ax 2mQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JgDZtxs+8PHwUpEzYdFhW6BWl26WBmcLen5s8o6wKXQ=; b=P2BqBfj4b2shQ+YFxjcIYXS2Ra/CbUvtP+cqeuhhMuJlmgkcDf0NeLaxXZXsYiksDv ncdD26ekli7kNh8kg2OPNt/alwIupUtYWVua/1Jac2vExV52PB4HKz5nAD8wHrUm6DRJ AC4YSWkdu0UlkuLGqBiFuNQoMQTYSr92vwwBfnPC7WQ5jZVgg7l+PqVuhSafSGwSTxZf DFlWDJydqcI9ke5SDbvk/rQ/taqiv8kDn9OyppvDXhhZ4GP7ioNU//pKWWN5TYRJThfi 1qBOXKsw2DO9+sfm1YjAUy/W6l/hGXr7EL9LbeHKLA3yihdb6O8SGgxWOQ7J+XVICkBm K2og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YYomkZL2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si18314813pgv.588.2018.10.17.15.47.27; Wed, 17 Oct 2018 15:47:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YYomkZL2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbeJRGo6 (ORCPT + 99 others); Thu, 18 Oct 2018 02:44:58 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40510 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727583AbeJRGo5 (ORCPT ); Thu, 18 Oct 2018 02:44:57 -0400 Received: by mail-wr1-f65.google.com with SMTP id d2-v6so31463735wro.7 for ; Wed, 17 Oct 2018 15:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JgDZtxs+8PHwUpEzYdFhW6BWl26WBmcLen5s8o6wKXQ=; b=YYomkZL2uQ/A7k6UEvzO1LqwfDwjfxPbNqsYfwWe7a7RTa+UTu24LbPJEUkx3qq+ms J3qCLFoPoS9xtZBMgl9/2Uf4gBPhyvrWacnIPDR7BjsnMZga+3wy+drGv7PmSV64IQ/Q H9jr+IqFL1s0pwTfIhgpAUzJ/OnND7FUyRLcc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JgDZtxs+8PHwUpEzYdFhW6BWl26WBmcLen5s8o6wKXQ=; b=RLgtysIpumStXi9f7NUZrWZ6qGPVs+j92vYlwjI8wQkwpRjN7mZHeVEMHcOcuKPmTQ UiW+dGcnZG3xrFhkGGAJ4t1r8dCNiMNNPEzbvD8+naIBd0KlIZkax0/T6P5614zmLEDP ZVVb2JlrREFrWhFs+/GrquiPzXYJMIlGREE+caFdHAxq5NeGm/8ff7tyuTDKn66KnFf/ lwUXXGs850CM6zx+VNl0F613hlg7QzNzxXZY08RoQnaJXnu0BYctK4mgUVz1B+tnu5qH Rtf+yXJj0VKGm4o6vV408vhl6CqxEEtCKu1sZekL81ftgP3i7zYxJEeKa7bXYcWqpMIf U0jg== X-Gm-Message-State: ABuFfogZjTl0X1EmHSzNPrFs1xA8R/VlR/s+2KBnkWpXPUlS0JDXtOY4 qDCJD58t0ooZUSsPLGgUsANhcM77J/FUBQzNpbbByw== X-Received: by 2002:adf:916a:: with SMTP id j97-v6mr26929538wrj.179.1539816424987; Wed, 17 Oct 2018 15:47:04 -0700 (PDT) MIME-Version: 1.0 References: <20181016235120.138227-1-brendanhiggins@google.com> <20181016235120.138227-23-brendanhiggins@google.com> In-Reply-To: <20181016235120.138227-23-brendanhiggins@google.com> From: Rob Herring Date: Wed, 17 Oct 2018 17:46:54 -0500 Message-ID: Subject: Re: [RFC v1 22/31] kunit: mock: add the concept of spyable functions To: brendanhiggins@google.com Cc: Greg Kroah-Hartman , keescook@google.com, mcgrof@kernel.org, shuah@kernel.org, joel@jms.id.au, Michael Ellerman , Joe Perches , brakmo@fb.com, Steven Rostedt , Tim.Bird@sony.com, khilman@baylibre.com, Julia Lawall , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Linux Kernel Mailing List , jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 16, 2018 at 6:54 PM Brendan Higgins wrote: > > Adds the concept of spying like in Mockito > (http://static.javadoc.io/org.mockito/mockito-core/2.20.0/org/mockito/Mockito.html#spy-T-). > This allows a function declaration to be labled as spyable which allows > the function to be mocked *and* to allow the mock to invoke the original > function definition. We can already hook into arbitrary functions ftrace. Wouldn't utilizing that simplify features like this and avoid having to touch existing code for testing? Not sure what it would take to enable ftrace on UML. It is at least partially compiler dependent. Rob