From patchwork Thu Jul 17 17:59:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 33801 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC6DF20CA0 for ; Thu, 17 Jul 2014 17:59:28 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf19414022pab.1 for ; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=iQTvkjICdYJnasUPVicklHQF1ru/SYLRvcecVFB6YPE=; b=M3xmTbcl2GfsThYNY0bJimMcIRxXtpi8R+ZkfFErUX4wCoHfV/Z86GnJxa262316Hy vxqRKIqkNnGcMC6vjGAq+6roP7MG0HQI0M3mLhYJjEulhjAZRXiMtjV7XuSZ/tH8YjmD /vAMNr8N6peKt8dQs7hfmkS0fvftHgZ7T8oeEGc6GTEj5vVfEssOhDFuy4LPgb//OfZW HlP0ehM8JwSlcbTKTtfuO9tRmqAfMlvp9EgOodbMUGpwH6QG4QPlTFCgHqXfgIp58T0U 3GZrCLxcIhQYweAUbu7f7By3kyCKRYUSNmN7tHcADs/O09qltGAVj3NK3sQ7RJRrN6HG vjYw== X-Gm-Message-State: ALoCoQlcfg4ssoHOVd1Jd3KHidvXpoLmh9J1jOgS8UuFwbmMzF8f9qAoQBONBhxL/eR5M115O+oq X-Received: by 10.66.144.7 with SMTP id si7mr17335289pab.32.1405619967910; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.231 with SMTP id u94ls775450qge.62.gmail; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) X-Received: by 10.236.30.105 with SMTP id j69mr21775909yha.19.1405619967801; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id q61si8459827yhi.144.2014.07.17.10.59.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jul 2014 10:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so3829576vcb.10 for ; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr7786598vcf.71.1405619967545; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp56066vcb; Thu, 17 Jul 2014 10:59:27 -0700 (PDT) X-Received: by 10.68.171.1 with SMTP id aq1mr5306565pbc.115.1405619966623; Thu, 17 Jul 2014 10:59:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id od9si1567554pdb.296.2014.07.17.10.59.26; Thu, 17 Jul 2014 10:59:26 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbaGQR7V (ORCPT + 23 others); Thu, 17 Jul 2014 13:59:21 -0400 Received: from mail-ie0-f182.google.com ([209.85.223.182]:41981 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbaGQR7T (ORCPT ); Thu, 17 Jul 2014 13:59:19 -0400 Received: by mail-ie0-f182.google.com with SMTP id y20so3454639ier.41 for ; Thu, 17 Jul 2014 10:59:19 -0700 (PDT) X-Received: by 10.50.43.234 with SMTP id z10mr30342995igl.28.1405619959034; Thu, 17 Jul 2014 10:59:19 -0700 (PDT) Received: from localhost.localdomain (c-24-245-18-91.hsd1.mn.comcast.net. [24.245.18.91]) by mx.google.com with ESMTPSA id j10sm8487955igv.17.2014.07.17.10.59.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jul 2014 10:59:18 -0700 (PDT) From: Alex Elder To: akpm@linux-foundation.org Cc: kay@vrfy.org, pmladek@suse.cz, bp@suse.de, john.stultz@linaro.org, jack@suse.cz, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] printk: stop actually recording LOG_PREFIX Date: Thu, 17 Jul 2014 12:59:11 -0500 Message-Id: <1405619953-5475-4-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405619953-5475-1-git-send-email-elder@linaro.org> References: <1405619953-5475-1-git-send-email-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Whenever log_store() sees a LOG_PREFIX flag it marks the previous log entry (if there is one) with LOG_NEWLINE, which (also) produces the desired effect. There's therefore no need to record LOG_PREFIX in log records. If no log entries contain LOG_PREFIX, devkmsg_read() and msg_print_text() don't need to check for it. Signed-off-by: Alex Elder --- kernel/printk/printk.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 6b72a77..df38b5e 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -432,8 +432,11 @@ static int log_store(int facility, int level, * If we're forcing a new log record, update the flags for * the previous one to mark it complete. */ - if (flags & LOG_PREFIX && log_last_msg) - log_last_msg->flags |= LOG_NEWLINE; + if (flags & LOG_PREFIX) { + if (log_last_msg) + log_last_msg->flags |= LOG_NEWLINE; + flags &= ~LOG_PREFIX; + } msg = (struct printk_log *)(log_buf + log_next_idx); memcpy(log_text(msg), text, text_len); @@ -633,7 +636,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, * a record that should be merged with one or more earlier records. * And a '-' indicates a "normal" self-contained single record. */ - if (!(user->prev & LOG_NEWLINE) && !(msg->flags & LOG_PREFIX)) + if (!(user->prev & LOG_NEWLINE)) cont = '+'; else if (!(msg->flags & LOG_NEWLINE)) cont = 'c'; @@ -1020,7 +1023,7 @@ static size_t msg_print_text(const struct printk_log *msg, enum log_flags prev, bool newline = true; size_t len = 0; - if (!(prev & LOG_NEWLINE) && !(msg->flags & LOG_PREFIX)) + if (!(prev & LOG_NEWLINE)) prefix = false; if (!(msg->flags & LOG_NEWLINE))