You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/16 18:18:47 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #6866: sched: Simplify the cpuload process

xiaoxiang781216 opened a new pull request, #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866

   ## Summary
   1.Forward nxsched_process_cpuload to nxsched_process_cpuload_ticks directly
   2.Define the dummy nxsched_process_cpuload_ticks when CPULOAD isn't enabled
   3.Remove the weak attribute from nxsched_process_cpuload_ticks
   
   ## Impact
   Code refactor only
   
   ## Testing
   Pass CI
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r947524734


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   maybe define part can be moved to `sched/sched/sched.h`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r949462453


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   Still not clear to me why we can't
   ```
   #if !defined(CONFIG_SCHED_CPULOAD_EXTCLK)
   
   /* CPU load measurement support */
   
   #  ifdef CONFIG_SCHED_CPULOAD
   void nxsched_process_cpuload_ticks(uint32_t ticks);
   #  else
   #    define nxsched_process_cpuload_ticks(ticks)
   #  endif
   
   #  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
   #elif defined(CONFIG_SCHED_CPULOAD)
   # define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
   #endif
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r947756566


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   No, since the chip need call nxsched_process_cpuload_ticks when CONFIG_SCHED_CPULOAD_EXTCLK is defined.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r949471638


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   Or even
   ```
   /* CPU load measurement support */
   
   #ifdef CONFIG_SCHED_CPULOAD
   void nxsched_process_cpuload_ticks(uint32_t ticks);
   #else
   #  define nxsched_process_cpuload_ticks(ticks)
   #endif
   
   #define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
   ```
   
   I mean that in `include/nuttx/arch.h` the `# define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)` in case if `CONFIG_SCHED_CPULOAD_EXTCLK` is defined and in `sched/sched/sched.h` the `# define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)` if `CONFIG_SCHED_CPULOAD_EXTCLK` is not defined, so this seems to be duplication for me. Am I missing something?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r949502210


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   In case if CONFIG_SCHED_CPULOAD_EXTCLK is defined, chip call can call either nxsched_process_cpuload or nxsched_process_cpuload_ticks. If we only define nxsched_process_cpuload in sched/sched/sched.h, how the code in arch/src/xxx call it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6866: sched: Simplify the cpuload process

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6866:
URL: https://github.com/apache/incubator-nuttx/pull/6866#discussion_r949462453


##########
include/nuttx/arch.h:
##########
@@ -2278,7 +2253,8 @@ void weak_function nxsched_process_cpuload(void);
  ****************************************************************************/
 
 #if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK)
-void weak_function nxsched_process_cpuload_ticks(uint32_t ticks);
+void nxsched_process_cpuload_ticks(uint32_t ticks);
+#  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)

Review Comment:
   Still not clear to me why we can't
   ```
   #if !defined(CONFIG_SCHED_CPULOAD_EXTCLK)
   
   /* CPU load measurement support */
   
   #  ifdef CONFIG_SCHED_CPULOAD
   void nxsched_process_cpuload_ticks(uint32_t ticks);
   #  else
   #    define nxsched_process_cpuload_ticks(ticks)
   #  endif
   
   #  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
   #elif defined(CONFIG_SCHED_CPULOAD)
   #  define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
   #endif
   ```
   in `sched/sched/sched.h`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org