linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>, linux-ide@vger.kernel.org
Subject: Re: [PATCH 39/46] libata: add tracepoints for ATA error handling
Date: Mon, 10 Feb 2020 17:45:40 +0100	[thread overview]
Message-ID: <f696fe99-b16f-83fe-99c1-d90b78dbfbea@samsung.com> (raw)
In-Reply-To: <20200204165547.115220-40-hare@suse.de>


On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add tracepoints for ATA error handling, and remove the related
> DPRINTK() calls.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>

Please move the removal to a separate (post-)patch
(like it has been done for reset tracepoints).

Also there is a lot of complaints from checkpatch.pl script
regarding CodingStyle:

WARNING: line over 80 characters
#259: FILE: include/trace/events/libata.h:459:
+       TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),

ERROR: space prohibited after that open parenthesis '('
#264: FILE: include/trace/events/libata.h:464:
+               __field( unsigned int,  ata_port )

ERROR: space prohibited before that close parenthesis ')'
#264: FILE: include/trace/events/libata.h:464:
+               __field( unsigned int,  ata_port )

ERROR: space prohibited after that open parenthesis '('
#265: FILE: include/trace/events/libata.h:465:
+               __field( unsigned int,  ata_dev )

ERROR: space prohibited before that close parenthesis ')'
#265: FILE: include/trace/events/libata.h:465:
+               __field( unsigned int,  ata_dev )

ERROR: space prohibited after that open parenthesis '('
#266: FILE: include/trace/events/libata.h:466:
+               __field( unsigned int,  eh_action )

ERROR: space prohibited before that close parenthesis ')'
#266: FILE: include/trace/events/libata.h:466:
+               __field( unsigned int,  eh_action )

WARNING: line over 80 characters
#281: FILE: include/trace/events/libata.h:481:
+            TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),

WARNING: line over 80 characters
#285: FILE: include/trace/events/libata.h:485:
+            TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),

ERROR: space prohibited after that open parenthesis '('
#302: FILE: include/trace/events/libata.h:575:
+               __field( unsigned int,  ata_port )

ERROR: space prohibited before that close parenthesis ')'
#302: FILE: include/trace/events/libata.h:575:
+               __field( unsigned int,  ata_port )

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/ata/libata-eh.c       | 22 +++++-----------
>  drivers/ata/libata-pmp.c      |  8 ------
>  include/trace/events/libata.h | 60 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 67 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index ef3576eb5874..f37dad5f9c17 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -526,8 +526,6 @@ void ata_scsi_error(struct Scsi_Host *host)
>  	unsigned long flags;
>  	LIST_HEAD(eh_work_q);
>  
> -	DPRINTK("ENTER\n");
> -
>  	spin_lock_irqsave(host->host_lock, flags);
>  	list_splice_init(&host->eh_cmd_q, &eh_work_q);
>  	spin_unlock_irqrestore(host->host_lock, flags);
> @@ -541,7 +539,6 @@ void ata_scsi_error(struct Scsi_Host *host)
>  	/* finish or retry handled scmd's and clean up */
>  	WARN_ON(!list_empty(&eh_work_q));
>  
> -	DPRINTK("EXIT\n");
>  }
>  
>  /**
> @@ -933,7 +930,7 @@ void ata_std_sched_eh(struct ata_port *ap)
>  	ata_eh_set_pending(ap, 1);
>  	scsi_schedule_eh(ap->scsi_host);
>  
> -	DPRINTK("port EH scheduled\n");
> +	trace_ata_std_sched_eh(ap);
>  }
>  EXPORT_SYMBOL_GPL(ata_std_sched_eh);
>  
> @@ -1060,7 +1057,7 @@ static void __ata_port_freeze(struct ata_port *ap)
>  
>  	ap->pflags |= ATA_PFLAG_FROZEN;
>  
> -	DPRINTK("ata%u port frozen\n", ap->print_id);
> +	trace_ata_port_freeze(ap);
>  }
>  
>  /**
> @@ -1208,7 +1205,7 @@ void ata_eh_thaw_port(struct ata_port *ap)
>  
>  	spin_unlock_irqrestore(ap->lock, flags);
>  
> -	DPRINTK("ata%u port thawed\n", ap->print_id);
> +	trace_ata_port_thaw(ap);
>  }
>  
>  static void ata_eh_scsidone(struct scsi_cmnd *scmd)
> @@ -1347,6 +1344,8 @@ void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,
>  	struct ata_eh_context *ehc = &link->eh_context;
>  	unsigned long flags;
>  
> +	trace_ata_eh_about_to_do(link, dev ? dev->devno : 0, action);
> +
>  	spin_lock_irqsave(ap->lock, flags);
>  
>  	ata_eh_clear_action(link, dev, ehi, action);
> @@ -1377,6 +1376,8 @@ void ata_eh_done(struct ata_link *link, struct ata_device *dev,
>  {
>  	struct ata_eh_context *ehc = &link->eh_context;
>  
> +	trace_ata_eh_done(link, dev ? dev->devno : 0, action);
> +
>  	ata_eh_clear_action(link, dev, &ehc->i, action);
>  }
>  
> @@ -2119,8 +2120,6 @@ static void ata_eh_link_autopsy(struct ata_link *link)
>  	u32 serror;
>  	int rc;
>  
> -	DPRINTK("ENTER\n");
> -
>  	if (ehc->i.flags & ATA_EHI_NO_AUTOPSY)
>  		return;
>  
> @@ -2227,7 +2226,6 @@ static void ata_eh_link_autopsy(struct ata_link *link)
>  		ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask);
>  		trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask);
>  	}
> -	DPRINTK("EXIT\n");
>  }
>  
>  /**
> @@ -3126,8 +3124,6 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
>  	unsigned long flags;
>  	int rc = 0;
>  
> -	DPRINTK("ENTER\n");
> -
>  	/* For PATA drive side cable detection to work, IDENTIFY must
>  	 * be done backwards such that PDIAG- is released by the slave
>  	 * device before the master device is identified.
> @@ -3241,7 +3237,6 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
>  
>   err:
>  	*r_failed_dev = dev;
> -	DPRINTK("EXIT rc=%d\n", rc);
>  	return rc;
>  }
>  
> @@ -3755,8 +3750,6 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
>  	int rc, nr_fails;
>  	unsigned long flags, deadline;
>  
> -	DPRINTK("ENTER\n");
> -
>  	/* prep for recovery */
>  	ata_for_each_link(link, ap, EDGE) {
>  		struct ata_eh_context *ehc = &link->eh_context;
> @@ -3964,7 +3957,6 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
>  	if (rc && r_failed_link)
>  		*r_failed_link = link;
>  
> -	DPRINTK("EXIT, rc=%d\n", rc);
>  	return rc;
>  }
>  
> diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
> index 3ff14071617c..438caf3a7d8c 100644
> --- a/drivers/ata/libata-pmp.c
> +++ b/drivers/ata/libata-pmp.c
> @@ -652,8 +652,6 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)
>  	u32 *gscr = (void *)ap->sector_buf;
>  	int rc;
>  
> -	DPRINTK("ENTER\n");
> -
>  	ata_eh_about_to_do(link, NULL, ATA_EH_REVALIDATE);
>  
>  	if (!ata_dev_enabled(dev)) {
> @@ -686,12 +684,10 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)
>  
>  	ata_eh_done(link, NULL, ATA_EH_REVALIDATE);
>  
> -	DPRINTK("EXIT, rc=0\n");
>  	return 0;
>  
>   fail:
>  	ata_dev_err(dev, "PMP revalidation failed (errno=%d)\n", rc);
> -	DPRINTK("EXIT, rc=%d\n", rc);
>  	return rc;
>  }
>  
> @@ -759,8 +755,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
>  	int detach = 0, rc = 0;
>  	int reval_failed = 0;
>  
> -	DPRINTK("ENTER\n");
> -
>  	if (dev->flags & ATA_DFLAG_DETACH) {
>  		detach = 1;
>  		goto fail;
> @@ -827,7 +821,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
>  	/* okay, PMP resurrected */
>  	ehc->i.flags = 0;
>  
> -	DPRINTK("EXIT, rc=0\n");
>  	return 0;
>  
>   fail:
> @@ -837,7 +830,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
>  	else
>  		ata_dev_disable(dev);
>  
> -	DPRINTK("EXIT, rc=%d\n", rc);
>  	return rc;
>  }
>  
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index 40027d8424f8..c882c8f9b405 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -454,6 +454,37 @@ TRACE_EVENT(ata_eh_link_autopsy_qc,
>  		  __parse_eh_err_mask(__entry->eh_err_mask))
>  );
>  
> +DECLARE_EVENT_CLASS(ata_eh_action_template,
> +
> +	TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> +
> +	TP_ARGS(link, devno, eh_action),
> +
> +	TP_STRUCT__entry(
> +		__field( unsigned int,	ata_port )
> +		__field( unsigned int,	ata_dev	)
> +		__field( unsigned int,	eh_action )
> +	),
> +
> +	TP_fast_assign(
> +		__entry->ata_port	= link->ap->print_id;
> +		__entry->ata_dev	= link->pmp + devno;
> +		__entry->eh_action	= eh_action;
> +	),
> +
> +	TP_printk("ata_port=%u ata_dev=%u eh_action=%s",
> +		  __entry->ata_port, __entry->ata_dev,
> +		  __parse_eh_action(__entry->eh_action))
> +);
> +
> +DEFINE_EVENT(ata_eh_action_template, ata_eh_about_to_do,
> +	     TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> +	     TP_ARGS(link, devno, eh_action));
> +
> +DEFINE_EVENT(ata_eh_action_template, ata_eh_done,
> +	     TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> +	     TP_ARGS(link, devno, eh_action));
> +
>  DECLARE_EVENT_CLASS(ata_link_reset_begin_template,
>  
>  	TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> @@ -534,6 +565,35 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_slave_postreset,
>  	     TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
>  	     TP_ARGS(link, class, rc));
>  
> +DECLARE_EVENT_CLASS(ata_port_eh_begin_template,
> +
> +	TP_PROTO(struct ata_port *ap),
> +
> +	TP_ARGS(ap),
> +
> +	TP_STRUCT__entry(
> +		__field( unsigned int,	ata_port )
> +	),
> +
> +	TP_fast_assign(
> +		__entry->ata_port	= ap->print_id;
> +	),
> +
> +	TP_printk("ata_port=%u", __entry->ata_port)
> +);
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_std_sched_eh,
> +	     TP_PROTO(struct ata_port *ap),
> +	     TP_ARGS(ap));
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_port_freeze,
> +	     TP_PROTO(struct ata_port *ap),
> +	     TP_ARGS(ap));
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_port_thaw,
> +	     TP_PROTO(struct ata_port *ap),
> +	     TP_ARGS(ap));
> +
>  DECLARE_EVENT_CLASS(ata_sff_hsm_template,
>  
>  	TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
> 

  reply	other threads:[~2020-02-10 16:45 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
2020-02-04 16:55 ` [PATCH 01/46] libata: drop BPRINTK() Hannes Reinecke
2020-02-04 16:55 ` [PATCH 02/46] libata.h: whitespace and indentation fixes Hannes Reinecke
2020-02-10 11:51   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 03/46] libata-transport: Whitespace cleanup Hannes Reinecke
2020-02-10 11:52   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
2020-02-10 12:25   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 05/46] libata: remove pointless debugging messages Hannes Reinecke
2020-02-10 12:34   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 06/46] ata_piix: remove debugging message in piix_init() Hannes Reinecke
2020-02-10 12:36   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 07/46] libata-core: remove pointless debugging messages Hannes Reinecke
2020-02-05  8:08   ` Sergei Shtylyov
2020-02-10 12:37   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 08/46] libata: Add ata_port_classify() helper Hannes Reinecke
2020-02-10 12:44   ` Bartlomiej Zolnierkiewicz
2020-02-13  7:15     ` Hannes Reinecke
2020-02-04 16:55 ` [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
2020-02-05  1:51   ` kbuild test robot
2020-02-10 12:47   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter Hannes Reinecke
2020-02-10 12:51   ` Bartlomiej Zolnierkiewicz
2020-02-10 12:54     ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 11/46] sata_nv: move DPRINTK to ata debugging Hannes Reinecke
2020-02-10 13:25   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK Hannes Reinecke
2020-02-10 13:29   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 13/46] ata_piix: Drop DPRINTK() statement Hannes Reinecke
2020-02-10 13:32   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 14/46] libata: add reset tracepoints Hannes Reinecke
2020-02-10 13:42   ` Bartlomiej Zolnierkiewicz
2020-02-12 10:11     ` Hannes Reinecke
2020-02-04 16:55 ` [PATCH 15/46] ahci: drop DPRINTK() calls in reset Hannes Reinecke
2020-02-10 13:43   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 16/46] ahci_qorig: " Hannes Reinecke
2020-02-10 13:45   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 17/46] pata_octeon_cf: " Hannes Reinecke
2020-02-10 13:46   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 18/46] libahci: " Hannes Reinecke
2020-02-10 13:46   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 19/46] sata_rcar: " Hannes Reinecke
2020-02-10 13:48   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 20/46] sata_sil24: " Hannes Reinecke
2020-02-10 13:48   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 21/46] sata_fsl: " Hannes Reinecke
2020-02-10 13:49   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 22/46] libata-core: " Hannes Reinecke
2020-02-10 13:50   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 23/46] libata-sff: " Hannes Reinecke
2020-02-10 13:54   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 24/46] libata: tracepoints for bus-master DMA Hannes Reinecke
2020-02-10 15:21   ` Bartlomiej Zolnierkiewicz
2020-02-10 15:23     ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 25/46] libata-sff: add tracepoints for HSM state machine Hannes Reinecke
2020-02-10 15:32   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() Hannes Reinecke
2020-02-10 15:36   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command() Hannes Reinecke
2020-02-10 15:37   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
2020-02-10 15:40   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task() Hannes Reinecke
2020-02-10 15:44   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 30/46] libata-core: add postreset tracepoints Hannes Reinecke
2020-02-10 15:47   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK Hannes Reinecke
2020-02-10 15:48   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command() Hannes Reinecke
2020-02-10 15:49   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command() Hannes Reinecke
2020-02-10 15:51   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK Hannes Reinecke
2020-02-10 15:52   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 35/46] sata_rcar: " Hannes Reinecke
2020-02-10 15:52   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 36/46] sata_qstor: " Hannes Reinecke
2020-02-10 15:53   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
2020-02-10 15:59   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging Hannes Reinecke
2020-02-10 16:07   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 39/46] libata: add tracepoints for ATA error handling Hannes Reinecke
2020-02-10 16:45   ` Bartlomiej Zolnierkiewicz [this message]
2020-02-04 16:55 ` [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense Hannes Reinecke
2020-02-10 16:46   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 41/46] libata-core: move DPRINTK to ata debugging Hannes Reinecke
2020-02-10 16:48   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 42/46] libata: remove DPRINTK() macro Hannes Reinecke
2020-02-04 16:55 ` [PATCH 43/46] libata: kill ATA_MSG_INFO Hannes Reinecke
2020-02-10 16:49   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 44/46] libata: kill ATA_MSG_CTL Hannes Reinecke
2020-02-10 16:49   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 45/46] libata: remove references to ATA_DEBUG Hannes Reinecke
2020-02-10 16:50   ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 46/46] libata: remove ATA_NDEBUG Hannes Reinecke
2020-02-10 16:51   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f696fe99-b16f-83fe-99c1-d90b78dbfbea@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).