From patchwork Thu Feb 27 05:19:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 25440 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D47C220558 for ; Thu, 27 Feb 2014 05:19:33 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oy12sf7382194veb.9 for ; Wed, 26 Feb 2014 21:19:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=CGOQketXf0p6gdJpe+fwRWZ/OK9+a0JRwiX/k1SA5mA=; b=Jn1Z96fsjFwWMmXvkkQGKHIEnnXUV/DrhOj+UJyZbsGDXpI+YaT6dMOLuF9yMslu6i yEEm/PI4ydzz/V7UDVsnaKgAqXkFgnIHfUVk1EI7+tXluH2LHvhAwwwN8GT+85Y5Xey0 PFY3onyLBY7F/Nlkla1JyauVDq52ZQbzr0Rg+YSiWVO01GSI2iYPaA7YDyVb5kwHQ2mL k/qsVHnfq/X7pJAvkS6Ks0EPbO2DYq18fj3izvygkYHkmvQ5RYl6MIKyeB+iNknmc1Tu KUffdOKlkEAowDLAB75XD2IAIVFUyQOWFA4Oo5U9+VUqTVQk5Ter50qREkE5pbuZ4ZAE tW6Q== X-Gm-Message-State: ALoCoQmetwIfncMSXrYQYqIrDeYxtLz2g1krJZbkGT0jEGlbKyJTcXbnpTn6pwX7q2ZzQbFvEhSn X-Received: by 10.58.38.137 with SMTP id g9mr5366821vek.6.1393478373381; Wed, 26 Feb 2014 21:19:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.240 with SMTP id b103ls540577qge.57.gmail; Wed, 26 Feb 2014 21:19:33 -0800 (PST) X-Received: by 10.220.175.198 with SMTP id bb6mr149712vcb.31.1393478373296; Wed, 26 Feb 2014 21:19:33 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id xn5si840932vdc.55.2014.02.26.21.19.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 21:19:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id im17so1980277vcb.5 for ; Wed, 26 Feb 2014 21:19:33 -0800 (PST) X-Received: by 10.52.242.167 with SMTP id wr7mr7594094vdc.32.1393478373236; Wed, 26 Feb 2014 21:19:33 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp78064vcz; Wed, 26 Feb 2014 21:19:31 -0800 (PST) X-Received: by 10.66.246.229 with SMTP id xz5mr13211985pac.119.1393478371434; Wed, 26 Feb 2014 21:19:31 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id tu7si3195688pac.135.2014.02.26.21.19.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 21:19:31 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so943845pbb.19 for ; Wed, 26 Feb 2014 21:19:31 -0800 (PST) X-Received: by 10.68.201.226 with SMTP id kd2mr11000294pbc.157.1393478370961; Wed, 26 Feb 2014 21:19:30 -0800 (PST) Received: from [10.221.55.136] ([203.247.149.152]) by mx.google.com with ESMTPSA id f5sm22270498pat.11.2014.02.26.21.19.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 21:19:29 -0800 (PST) Message-ID: <530ECADD.501@linaro.org> Date: Thu, 27 Feb 2014 10:49:25 +0530 From: Sanjay Singh Rawat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: j.lelli@sssup.it Subject: [patch] rt-app : add thread policy in the thread-log-file X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sanjay.rawat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , hello Juri, Adding scheduling policy in the thread log header will be helpful. This small patch (attached) adds this. regards, sanjay >From c975724027efef8b840b557bca92e2bcd5cea9de Mon Sep 17 00:00:00 2001 From: Sanjay Singh Rawat Date: Thu, 27 Feb 2014 10:38:12 +0530 Subject: [PATCH] log scheduling policy in per thread logs --- src/rt-app.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rt-app.c b/src/rt-app.c index 605a662..d018687 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -160,6 +160,8 @@ void *thread_body(void *arg) { case rr: case fifo: + fprintf(data->log_handler, "# Policy : %s\n", + (data->sched_policy == rr ? "SCHED_RR" : "SCHED_FIFO")); param.sched_priority = data->sched_prio; ret = pthread_setschedparam(pthread_self(), data->sched_policy, @@ -181,6 +183,7 @@ void *thread_body(void *arg) break; case other: + fprintf(data->log_handler, "# Policy : SCHED_OTHER\n"); log_notice("[%d] starting thread with period: %lu, exec: %lu," "deadline: %lu", data->ind, @@ -192,6 +195,7 @@ void *thread_body(void *arg) break; #ifdef AQUOSA case aquosa: + fprintf(data->log_handler, "# Policy : AQUOSA\n"); data->params.Q_min = round((timespec_to_usec(&data->min_et) * (( 100.0 + data->sched_prio ) / 100)) / (data->fragment * 1.0)); data->params.Q = round((timespec_to_usec(&data->max_et) * (( 100.0 + data->sched_prio ) / 100)) / (data->fragment * 1.0)); data->params.P = round(timespec_to_usec(&data->period) / (data->fragment * 1.0)); @@ -214,6 +218,7 @@ void *thread_body(void *arg) #endif #ifdef DLSCHED case deadline: + fprintf(data->log_handler, "# Policy : SCHED_DEADLINE\n"); tid = gettid(); attr.size = sizeof(attr); attr.sched_flags = 0; -- 1.7.10.4