<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thank you for your fast response, everybody! <br>
</p>
<p><br>
</p>
<p>Interestingly, I am still getting the same error even after changing the local_cpu_state() definition from &__get_cpu_var(demo_cpu_state) to this_cpu_ptr(&demo_cpu_state). The implicitly declared function warning for __get_cpu_var() is gone, but the implicitly
 declared function warning for is_running() is still there, which I find odd. <br>
</p>
<p><br>
</p>
<p>Can anybody say where is_running() is defined? I'm pretty sure I have the correct headers included, but I may be wrong.
<br>
</p>
<p><br>
</p>
<p>Is there anything else anyone can think of that may be causing this problem? <br>
</p>
<p><br>
</p>
<p>Thanks! - Nick <br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> litmus-dev-bounces@lists.litmus-rt.org <litmus-dev-bounces@lists.litmus-rt.org> on behalf of Mahircan Gul <mahircg@mpi-sws.org><br>
<b>Sent:</b> Wednesday, October 26, 2016 5:57 PM<br>
<b>To:</b> litmus-dev@lists.litmus-rt.org<br>
<b>Subject:</b> Re: [LITMUS^RT] litmus-dev Digest, Vol 56, Issue 9</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Greetings<br>
<br>
As mentioned in a previous reply, the issue arises due to changes in <br>
Linux kernel versions. More specifically, macros for accessing the <br>
per-CPU variables has changed between kernel v 3.x to 4.x.<br>
<br>
I guess those tutorials were written for the LITMUS version that was <br>
based on Linux 3.x. Therefore, using the old version of macros within <br>
the current kernel version (I'm assuming you are writing the plug-in on <br>
Linux v 4.x) yields to the errors you mentioned.<br>
<br>
Changing<br>
<br>
        <br>
        #define local_cpu_state() (&__get_cpu_var(demo_cpu_state))<br>
<br>
to (mind the address-of operator)<br>
<br>
        #define local_cpu_state() (this_cpu_ptr(&demo_cpu_state))<br>
<br>
should take care of the issue.<br>
<br>
The change above should get your development process up and running! The <br>
tutorials need to be updated at some point, though.<br>
<br>
Mahir<br>
<br>
On 10/26/2016 07:09 PM, litmus-dev-request@lists.litmus-rt.org wrote:<br>
> Send litmus-dev mailing list submissions to<br>
>        litmus-dev@lists.litmus-rt.org<br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
>        <a previewremoved="true" id="LPlnk945848" href="https://lists.litmus-rt.org/listinfo/litmus-dev">
https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
> or, via email, send a message with subject or body 'help' to<br>
>        litmus-dev-request@lists.litmus-rt.org<br>
><br>
> You can reach the person managing the list at<br>
>        litmus-dev-owner@lists.litmus-rt.org<br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of litmus-dev digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
>     1. Create a Plugin Tutorial Step 5 (NICHOLAS ALLAN KLEPP)<br>
>     2. Re: Create a Plugin Tutorial Step 5 (shijunjie92)<br>
><br>
><br>
> ----------------------------------------------------------------------<br>
><br>
> Message: 1<br>
> Date: Wed, 26 Oct 2016 17:01:02 +0000<br>
> From: NICHOLAS ALLAN KLEPP <nickbk@uga.edu><br>
> To: "litmus-dev@lists.litmus-rt.org" <litmus-dev@lists.litmus-rt.org><br>
> Subject: [LITMUS^RT] Create a Plugin Tutorial Step 5<br>
> Message-ID:<br>
>        <BL2PR02MB465FD2B01B25792C2378779D5AB0@BL2PR02MB465.namprd02.prod.outlook.com><br>
>        <br>
> Content-Type: text/plain; charset="iso-8859-1"<br>
><br>
> Hello!<br>
><br>
><br>
> I am following the Create a Plugin Tutorial and I am getting a compilation error after I add the scheduling decision logic in step 5. The error seems to be a problem with the demo_requeue() method. Here is the error message generated on compilation:<br>
><br>
><br>
> litmus/sched_demo.c: In function 'demo_requeue':<br>
> litmus/sched_demo.c:32:28: error: dereferencing pointer to incomplete type<br>
>         __add_ready(&cpu_state->local_queues,tsk);<br>
>                              ^<br>
> litmus/sched_demo.c:37:28: error: dereferencing pointer to incomplete type<br>
>         add_release(&cpu_state->local_queues,tsk);<br>
>                              ^<br>
> litmus/sched_demo.c: In function 'demo_schedule':<br>
> litmus/sched_demo.c:69:10: error: implicit declaration of function '__get_cpu_var' [-Werror=implicit-function-declaration]<br>
>     struct demo_cpu_state *local_state = local_cpu_state();<br>
>            ^<br>
> litmus/sched_demo.c:14:28: error: lvalue required as unary '&' operand<br>
>   #define local_cpu_state() (&__get_cpu_var(demo_cpu_state))<br>
>                              ^<br>
> litmus/sched_demo.c:69:40: note: in expansion of macro 'local_cpu_state'<br>
>     struct demo_cpu_state *local_state = local_cpu_state();<br>
>                                          ^<br>
> litmus/sched_demo.c:83:3: error: implicit declaration of function 'is_running' [-Werror=implicit-function-declaration]<br>
>     self_suspends = exists && !is_running(prev);<br>
>     ^<br>
> cc1: some warnings being treated as errors<br>
> scripts/Makefile.build:258: recipe for target 'litmus/sched_demo.o' failed<br>
><br>
><br>
> In searching the mailing list for similar problems I ran into a thread which did describe the dereferencing pointer to incomplete type error. There are two responses in that thread which I found to be possibly illuminating. One:<br>
><br>
><br>
> On May 7, 2013, at 2:11 PM, Bj?rn Brandenburg <bbb at mpi-sws.org> wrote:<br>
><br>
>> On May 7, 2013, at 9:29 AM, Schorr Stefan <stschorr at eit.uni-kl.de> wrote:<br>
>>> I'm trying to follow the Create A Plugin Tutorial from the webpage.<br>
>>> The first steps work like a charm, step 4 however doesn't compile :(<br>
>>><br>
>>> I copied the code from the website and I created a new local git<br>
>>> branch, so I'm absolutely sure that the only file I changed - apart<br>
>>> from the Makefile - is sched_demo.c (so I don't understand why<br>
>>> the error messages below point to .h files).<br>
>>><br>
>>> Please give me some hint what goes wrong here...<br>
>>><br>
>>> Best Regards<br>
>>> Stefan<br>
>>><br>
>>><br>
>>> Here's the error I get, when doing make bzImage<br>
>>><br>
>>> In file included from litmus/sched_demo.c:3:<br>
>>> include/litmus/litmus.h:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'litmus_clock'<br>
>>> include/litmus/litmus.h: In function 'is_kernel_np':<br>
>>> include/litmus/litmus.h:120: error: dereferencing pointer to incomplete type<br>
>><br>
>> Hi Stefan,<br>
>><br>
>> this is a configuration error in LITMUS^RT. Please enable the configuration option CONFIG_NP_SECTION, which should silence the error. Sorry about that...<br>
><br>
> Actually, litmus/litmus.h already has correct dummy implementations for the !CONFIG_NP_SECTION case, so it's something different. Have you tried a 'make clean'?<br>
> - Bj?rn<br>
><br>
> And two:<br>
><br>
>> On 05/07/2013 02:19 PM, Bj?rn Brandenburg wrote:<br>
>>> If it doesn't go away, you are probably missing a header file. Here are the one from the reference version. Does it fail with these headers as well?<br>
>> Hi Bj?rn,<br>
>> thanks for the fast reply!<br>
>> There's no change after make clean.<br>
>> I paste my C code here:<br>
>><br>
> Commit c5248a7288e54c2b5e2bba8aa2677772542bf90e compiles for me. Can you please try compiling c5248a7288e54c2b5e2bba8aa2677772542bf90e and, if it doesn't work, send me your configuration?<br>
><br>
> Thanks,<br>
> Bj?rn<br>
><br>
> I have verified that CONFIG_NP_SECTION is in fact enabled and as well I have run a 'make clean'. My next option was to try to checkout commit c5248a7288e54c2b5e2bba8aa2677772542bf90e, however, this is not allowed for my local repository. The error:<br>
><br>
> fatal: reference is not a tree: c5248a7288e54c2b5e2bba8aa2677772542bf90e<br>
><br>
> Is there something else I should do to make this work? Thanks!<br>
><br>
> - Nick<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a previewremoved="true" id="LPlnk155175" href="http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20161026/4601336b/attachment-0001.html">http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20161026/4601336b/attachment-0001.html</a>><br>
><br>
> ------------------------------<br>
><br>
> Message: 2<br>
> Date: Wed, 26 Oct 2016 19:09:08 +0100<br>
> From: "shijunjie92" <shijunjie92@gmail.com><br>
> To: "litmus-dev" <litmus-dev@lists.litmus-rt.org><br>
> Subject: Re: [LITMUS^RT] Create a Plugin Tutorial Step 5<br>
> Message-ID: <5810E331.1010709@gmail.com><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Because of the based linux version has been changed, some functions have been reweitten. You need to compare the tutorial with the latest version of LITMUS-RT's plugin (for example sched_pfp.c) . Rewrite the related functions yourself.<br>
><br>
> 2016-10-26<br>
><br>
> shijunjie92<br>
><br>
><br>
><br>
> ????NICHOLAS ALLAN KLEPP <nickbk@uga.edu><br>
> ?????2016-10-26 19:01<br>
> ???[LITMUS^RT] Create a Plugin Tutorial Step 5<br>
> ????"litmus-dev@lists.litmus-rt.org"<litmus-dev@lists.litmus-rt.org><br>
> ???<br>
><br>
> Hello!<br>
><br>
><br>
><br>
> I am following the Create a Plugin Tutorial and I am getting a compilation error after I add the scheduling decision logic in step 5. The error seems to be a problem with the demo_requeue() method. Here is the error message generated on compilation:<br>
><br>
><br>
><br>
> litmus/sched_demo.c: In function ?demo_requeue?:<br>
> litmus/sched_demo.c:32:28: error: dereferencing pointer to incomplete type<br>
>         __add_ready(&cpu_state->local_queues,tsk);<br>
>                              ^<br>
> litmus/sched_demo.c:37:28: error: dereferencing pointer to incomplete type<br>
>         add_release(&cpu_state->local_queues,tsk);<br>
>                              ^<br>
> litmus/sched_demo.c: In function ?demo_schedule?:<br>
> litmus/sched_demo.c:69:10: error: implicit declaration of function ?__get_cpu_var? [-Werror=implicit-function-declaration]<br>
>     struct demo_cpu_state *local_state = local_cpu_state();<br>
>            ^<br>
> litmus/sched_demo.c:14:28: error: lvalue required as unary ?&? operand<br>
>   #define local_cpu_state() (&__get_cpu_var(demo_cpu_state))<br>
>                              ^<br>
> litmus/sched_demo.c:69:40: note: in expansion of macro ?local_cpu_state?<br>
>     struct demo_cpu_state *local_state = local_cpu_state();<br>
>                                          ^<br>
> litmus/sched_demo.c:83:3: error: implicit declaration of function ?is_running? [-Werror=implicit-function-declaration]<br>
>     self_suspends = exists && !is_running(prev);<br>
>     ^<br>
> cc1: some warnings being treated as errors<br>
> scripts/Makefile.build:258: recipe for target 'litmus/sched_demo.o' failed<br>
><br>
><br>
><br>
> In searching the mailing list for similar problems I ran into a thread which did describe the dereferencing pointer to incomplete type error. There are two responses in that thread which I found to be possibly illuminating. One:<br>
><br>
><br>
><br>
> On May 7, 2013, at 2:11 PM, Bj?rn Brandenburg <bbb at mpi-sws.org> wrote:<br>
><br>
>> On May 7, 2013, at 9:29 AM, Schorr Stefan <stschorr at eit.uni-kl.de> wrote:<br>
>>> I'm trying to follow the Create A Plugin Tutorial from the webpage.<br>
>>> The first steps work like a charm, step 4 however doesn't compile :(<br>
>>><br>
>>> I copied the code from the website and I created a new local git<br>
>>> branch, so I'm absolutely sure that the only file I changed - apart<br>
>>> from the Makefile - is sched_demo.c (so I don't understand why<br>
>>> the error messages below point to .h files).<br>
>>><br>
>>> Please give me some hint what goes wrong here...<br>
>>><br>
>>> Best Regards<br>
>>> Stefan<br>
>>><br>
>>><br>
>>> Here's the error I get, when doing make bzImage<br>
>>><br>
>>> In file included from litmus/sched_demo.c:3:<br>
>>> include/litmus/litmus.h:74: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?litmus_clock?<br>
>>> include/litmus/litmus.h: In function ?is_kernel_np?:<br>
>>> include/litmus/litmus.h:120: error: dereferencing pointer to incomplete type<br>
>><br>
>> Hi Stefan,<br>
>><br>
>> this is a configuration error in LITMUS^RT. Please enable the configuration option CONFIG_NP_SECTION, which should silence the error. Sorry about that...<br>
><br>
> Actually, litmus/litmus.h already has correct dummy implementations for the !CONFIG_NP_SECTION case, so it's something different. Have you tried a 'make clean'?<br>
> - Bj?rn<br>
><br>
> And two:<br>
><br>
><br>
>> On 05/07/2013 02:19 PM, Bj?rn Brandenburg wrote:<br>
>>> If it doesn't go away, you are probably missing a header file. Here are the one from the reference version. Does it fail with these headers as well?<br>
>> Hi Bj?rn,<br>
>> thanks for the fast reply!<br>
>> There's no change after make clean.<br>
>> I paste my C code here:<br>
>><br>
> Commit c5248a7288e54c2b5e2bba8aa2677772542bf90e compiles for me. Can you please try compiling c5248a7288e54c2b5e2bba8aa2677772542bf90e and, if it doesn't work, send me your configuration?<br>
><br>
> Thanks,<br>
> Bj?rn<br>
><br>
><br>
><br>
> I have verified that CONFIG_NP_SECTION is in fact enabled and as well I have run a 'make clean'. My next option was to try to checkout commit c5248a7288e54c2b5e2bba8aa2677772542bf90e, however, this is not allowed for my local repository. The error:<br>
><br>
> fatal: reference is not a tree: c5248a7288e54c2b5e2bba8aa2677772542bf90e<br>
><br>
> Is there something else I should do to make this work? Thanks!<br>
><br>
><br>
> - Nick<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a previewremoved="true" id="LPlnk435477" href="http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20161026/6ccba09f/attachment.html">http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20161026/6ccba09f/attachment.html</a>><br>
><br>
> ------------------------------<br>
><br>
> _______________________________________________<br>
> litmus-dev mailing list<br>
> litmus-dev@lists.litmus-rt.org<br>
> <a previewremoved="true" id="LPlnk511996" href="https://lists.litmus-rt.org/listinfo/litmus-dev">
https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
><br>
><br>
> End of litmus-dev Digest, Vol 56, Issue 9<br>
> *****************************************<br>
<br>
<br>
_______________________________________________<br>
litmus-dev mailing list<br>
litmus-dev@lists.litmus-rt.org<br>
<a previewremoved="true" id="LPlnk62243" href="https://lists.litmus-rt.org/listinfo/litmus-dev">https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
</div>
</span></font></div>
</div>
</body>
</html>