From patchwork Fri Jun 13 07:09:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Gong X-Patchwork-Id: 4347461 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B6D2C9F314 for ; Fri, 13 Jun 2014 07:38:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AAD720265 for ; Fri, 13 Jun 2014 07:38:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F9AC20222 for ; Fri, 13 Jun 2014 07:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752427AbaFMHiW (ORCPT ); Fri, 13 Jun 2014 03:38:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:58125 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbaFMHiV (ORCPT ); Fri, 13 Jun 2014 03:38:21 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Jun 2014 00:32:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,470,1400050800"; d="asc'?scan'208";a="556777595" Received: from gchen-sby.bj.intel.com (HELO localhost) ([10.238.158.82]) by orsmga002.jf.intel.com with ESMTP; 13 Jun 2014 00:37:58 -0700 Date: Fri, 13 Jun 2014 03:09:28 -0400 From: "Chen, Gong" To: Steven Rostedt Cc: tony.luck@intel.com, bp@alien8.de, m.chehab@samsung.com, linux-acpi@vger.kernel.org Subject: Re: [PATCH 5/7 REVISION] trace, RAS: Add eMCA trace event interface Message-ID: <20140613070928.GA29351@gchen.bj.intel.com> Mail-Followup-To: Steven Rostedt , tony.luck@intel.com, bp@alien8.de, m.chehab@samsung.com, linux-acpi@vger.kernel.org References: <1402475691-30045-1-git-send-email-gong.chen@linux.intel.com> <1402553517-30208-1-git-send-email-gong.chen@linux.intel.com> <20140612092808.5f7bec5e@gandalf.local.home> <20140613021956.GA17509@gchen.bj.intel.com> <20140612230117.46758e3c@gandalf.local.home> <20140612230833.3c0f41b2@gandalf.local.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140612230833.3c0f41b2@gandalf.local.home> X-PGP-Key-ID: A43922C7 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jun 12, 2014 at 11:08:33PM -0400, Steven Rostedt wrote: > > > > The above array works, but I'm wondering why you don't just use the > > > > types themselves? > > > > > > > > That is: > > > > > > > > __field(uuid_le, fru_id) > > > > __field(struct cper_mem_err_compact, data) > > > > > > > Every time when I use above codes I will hit some compiler error like > > > "error: conversion to non-scalar type requested". It looks some > > > data types like above (unless typedef) can't be used in __field. > > > Is it true? How to fix that? > > > > > > > Ah, that's a bug in the ftrace.h file. I'll need to test this against > > it to see what error it gives. I'll work on that tomorrow as it's > > bedtime for me now. > > Wait, I take that back. I was thinking the error was with the > __array(). A __field() should work fine! > > Can you post me the patch you did and the error you get when you > compile. Here is the incremented patch & compiler error. PS: the same issue for __field(struct cper_mem_err_compact, data) In file included from include/trace/define_trace.h:90:0, from include/ras/ras_event.h:226, from drivers/ras/ras.c:13: include/trace/../../include/ras/ras_event.h: In function ‘ftrace_define_fields_extlog_mem_event’: include/trace/ftrace.h:330:9: error: conversion to non-scalar type requested struct ftrace_raw_##call field; \ ^ include/trace/ftrace.h:32:2: note: in expansion of macro ‘DECLARE_EVENT_CLASS’ DECLARE_EVENT_CLASS(name, \ ^ include/trace/../../include/ras/ras_event.h:23:1: note: in expansion of macro ‘TRACE_EVENT’ TRACE_EVENT(extlog_mem_event, ^ include/trace/ftrace.h:330:9: error: conversion to non-scalar type requested struct ftrace_raw_##call field; \ ^ include/trace/ftrace.h:32:2: note: in expansion of macro ‘DECLARE_EVENT_CLASS’ DECLARE_EVENT_CLASS(name, \ ^ include/trace/../../include/ras/ras_event.h:23:1: note: in expansion of macro ‘TRACE_EVENT’ TRACE_EVENT(extlog_mem_event, ^ scripts/Makefile.build:318: recipe for target 'drivers/ras/ras.o' failed diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index a794691..174aac1 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h @@ -35,7 +35,7 @@ TRACE_EVENT(extlog_mem_event, __field(u8, sev) __field(u64, pa) __field(u8, pa_mask_lsb) - __array(u8, fru_id, sizeof(uuid_le)) + __field(uuid_le, fru_id) __string(fru_text, fru_text) __array(u8, data, sizeof(struct cper_mem_err_compact)) ), @@ -56,7 +56,7 @@ TRACE_EVENT(extlog_mem_event, __entry->pa_mask_lsb = (u8)__ffs64(mem->physical_addr_mask); else __entry->pa_mask_lsb = ~0; - memcpy(__entry->fru_id, fru_id, sizeof(uuid_le)); + __entry->fru_id = *fru_id; __assign_str(fru_text, fru_text); cper_mem_err_pack(mem, __entry->data); ), @@ -68,7 +68,7 @@ TRACE_EVENT(extlog_mem_event, __entry->pa, __entry->pa_mask_lsb, cper_mem_err_unpack(p, __entry->data), - __entry->fru_id, + &__entry->fru_id, __get_str(fru_text)) );