Received: by 10.192.165.148 with SMTP id m20csp528436imm; Fri, 27 Apr 2018 03:15:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqlFsDab9FRvVCgS9p8gAy9xDJ4mAf90KVRLoMYd+FQxzt4ZPOHTguIn0xIgkwfTaqMQq9A X-Received: by 2002:a17:902:9a0c:: with SMTP id v12-v6mr1707266plp.162.1524824135729; Fri, 27 Apr 2018 03:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524824135; cv=none; d=google.com; s=arc-20160816; b=P2NIbNTB+zUaZr7ggrHWJqeGIWz+RcPLOO6ogCzltetpuJ2nf6kWk8vJ8IaB+NhMNZ jf3ZeBlbJi9dMYwIVQ81buQsdVhq3F6V/4AV1yyX2cefY+3CY9dKfPmCdBBfOurQftUC r48Z/dGz9PlfV5xTuQavtFQUFyh/zDTJDvt373lE6VW98kBAM6LGvhpH+L00coLvDvgQ 6DJsDZLcJmRO9X+x8pHvt7RHcOg2J0Tau+Kd6Ymyt5RW77p3CttEH1qsDgwdH0F+SKPL 0+l8PKps+uHmJ+mV1aP6PBZzFr218/uUEP9JcPtsh1MGozJwln84KS27+BGCgjpIINoY dPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=ZrX74Uunc3v9NGqxomOUif7F2JqiD64QVdwkeyulCng=; b=wELM3RHLR/QcIJ1Sr9YS2KuK6wkWD0h8db+R1mL41gjXyj1/VEsB1RVAlM+Bi/hU6x OkL1c6z3ACg8npIaB7ESaeXPSKyn6ALO7cT93o6TprhkdldbMWC8j+YrxL6euNzAajFS lIP2lrwLjxNUfAqoZmXyCuP2jktJTojAaTnqeNHUI14jPyjYlYS9Rk2xIR87VqQryPes N/E+nzHrv43zc3nV80WU6IfndycQ32ab0bjeZ0MVAD57zrdiSAt4HO1dv2chngSXQFCG luakMx2YvJYKhbx0YXoYjKOhRedXA3P7XiWMZBX8sNwnbl30JVc7rRsr2dYaGA37F2ue 9Vsg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7-v6si945753plk.129.2018.04.27.03.15.21; Fri, 27 Apr 2018 03:15:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932740AbeD0KOB (ORCPT + 99 others); Fri, 27 Apr 2018 06:14:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:32908 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757609AbeD0KN5 (ORCPT ); Fri, 27 Apr 2018 06:13:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1248F81A88D5; Fri, 27 Apr 2018 10:13:57 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E928215CDCE; Fri, 27 Apr 2018 10:13:55 +0000 (UTC) Date: Fri, 27 Apr 2018 12:13:53 +0200 From: Cornelia Huck To: Dong Jia Shi Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, borntraeger@de.ibm.com, bjsdjshi@linux.ibm.com, pasic@linux.ibm.com, pmorel@linux.ibm.com, Halil Pasic Subject: Re: [PATCH v2 5/5] vfio: ccw: add traceponits for interesting error paths Message-ID: <20180427121353.4453bdc2.cohuck@redhat.com> In-Reply-To: <20180423110113.59385-6-bjsdjshi@linux.vnet.ibm.com> References: <20180423110113.59385-1-bjsdjshi@linux.vnet.ibm.com> <20180423110113.59385-6-bjsdjshi@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 27 Apr 2018 10:13:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 27 Apr 2018 10:13:57 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Apr 2018 13:01:13 +0200 Dong Jia Shi wrote: typo in subject: s/traceponits/tracepoints/ > From: Halil Pasic > > Add some tracepoints so we can inspect what is not working as is should. > > Signed-off-by: Halil Pasic > Signed-off-by: Dong Jia Shi > --- > drivers/s390/cio/Makefile | 1 + > drivers/s390/cio/vfio_ccw_fsm.c | 16 +++++++- > drivers/s390/cio/vfio_ccw_trace.h | 77 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 93 insertions(+), 1 deletion(-) > create mode 100644 drivers/s390/cio/vfio_ccw_trace.h > @@ -135,6 +142,8 @@ static void fsm_io_request(struct vfio_ccw_private *private, > goto err_out; > > io_region->ret_code = cp_prefetch(&private->cp); > + trace_vfio_ccw_cp_prefetch(get_schid(private), > + io_region->ret_code); > if (io_region->ret_code) { > cp_free(&private->cp); > goto err_out; > @@ -142,11 +151,13 @@ static void fsm_io_request(struct vfio_ccw_private *private, > > /* Start channel program and wait for I/O interrupt. */ > io_region->ret_code = fsm_io_helper(private); > + trace_vfio_ccw_fsm_io_helper(get_schid(private), > + io_region->ret_code); > if (io_region->ret_code) { > cp_free(&private->cp); > goto err_out; > } > - return; > + goto out; > } else if (scsw->cmd.fctl & SCSW_FCTL_HALT_FUNC) { > /* XXX: Handle halt. */ > io_region->ret_code = -EOPNOTSUPP; > @@ -159,6 +170,9 @@ static void fsm_io_request(struct vfio_ccw_private *private, > > err_out: > private->state = VFIO_CCW_STATE_IDLE; > +out: > + trace_vfio_ccw_io_fctl(scsw->cmd.fctl, get_schid(private), > + io_region->ret_code); > } > > /* I really don't want to bikeshed, especially as some tracepoints are better than no tracepoints, but... We now trace fctl/schid/ret_code unconditionally (good). We trace the outcome of cp_prefetch() and fsm_io_helper() unconditionally. We don't, however, trace all things that may go wrong. We have the tracepoint at the end, but it cannot tell us where the error came from. Should we have tracepoints in every place (in this function) that may generate an error? Only if there is an actual error? Are the two enough for common debug scenarios? Opinions? We can just go ahead with this and improve things later on, I guess.