platform/kernel/linux-tizen-modules-source.git
20 months agozlogger sandbox/mmajewski2/vlogxd
Mateusz Majewski [Wed, 24 Aug 2022 10:35:44 +0000 (12:35 +0200)]
zlogger

Change-Id: I2ad69d857b45de626b5495bcbe0a23ee4f178c30

20 months agoimprovements
Mateusz Majewski [Wed, 24 Aug 2022 09:21:07 +0000 (11:21 +0200)]
improvements

Change-Id: Iec1d78153c06e06f4982d734c4e3cd8bf4a21c11

20 months agohashtable
Mateusz Majewski [Tue, 23 Aug 2022 12:05:16 +0000 (14:05 +0200)]
hashtable

Change-Id: I859bd4954ec9243cab3417c0b50f1309d05941c3

20 months agoTID tracking
Mateusz Majewski [Mon, 22 Aug 2022 13:43:13 +0000 (15:43 +0200)]
TID tracking

Change-Id: I55e0735135979de826cb9eb69ba2b8cf34901560

21 months agoIncluded tizen tv logging kernel module 56/279256/7
Arkadiusz Nowak [Tue, 21 Jun 2022 11:14:50 +0000 (13:14 +0200)]
Included tizen tv logging kernel module

Added write function via file interface
Additional ioctl's commands to set tag and prio
simple test like vlog_stdout program to check tag and prio change

Change-Id: Ia04f1add0a4904bfd92b156022c704bc62495931

2 years agotests: refactor logger tests 96/270396/2 accepted/tizen/unified/20220315.132341 submit/tizen/20220314.044827
Łukasz Stelmach [Thu, 27 Jan 2022 20:01:36 +0000 (21:01 +0100)]
tests: refactor logger tests

Move testing scenarios to separate functions and enable looped operation
for detection of deadlocks, race conditions and other rearly observable
phenomena.

Change-Id: I213e5d10d9f541411c9301d147132ed9fd4af57d
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoFix build errors 64/270864/1
Hyotaek Shim [Thu, 10 Feb 2022 08:35:02 +0000 (17:35 +0900)]
Fix build errors

-Wno-error=unused-result is applied to tests/logger since it's a test module.

[  160s] logger.c: In function 'dump_logger':
[  160s] logger.c:33:27: error: initialization of 'struct logger_entry *'
from incompatible pointer type 'char *' [-Werror=incompatible-pointer-types]
[  160s]    33 |  struct logger_entry *e = buf;
...
[  160s] logger.c: In function 'tstart':
[  160s] logger.c:24:2: error: ignoring return value of 'write', declared with
attribute warn_unused_result [-Werror=unused-result]
[  160s]    24 |  write(*fd, "child thread msg #1\nchild thread msg #2", 39);
[  160s]       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

Change-Id: I1496c7591031e3c61c3b3646712d641bdbdbdfe9
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agokdbus: Add KDBUS_SUPER_MAGIC define 69/270769/2 submit/tizen/20220208.090027
Karol Lewandowski [Tue, 8 Feb 2022 10:30:42 +0000 (11:30 +0100)]
kdbus: Add KDBUS_SUPER_MAGIC define

The define has been originally provided by kernel's uapi headers, allowing
userspace programs to detect kdbus file system type being in use.

This commit moves the define to this repository as in Tizen it is the source
of all kdbus interfaces and APIs.

Change-Id: I058b72a76e5a8a49160095f1e8b132d07b2ab921
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
2 years agoAdd -Wno-error=shadow build option for kdbus tests 22/270722/1 accepted/tizen/unified/20220210.105855 submit/tizen/20220208.055117
Hyotaek Shim [Tue, 8 Feb 2022 05:40:17 +0000 (14:40 +0900)]
Add -Wno-error=shadow build option for kdbus tests

In some different build environment (e.g., product divisions),
several strict compilation options can be added like -Werror=shadow.
Shadowing is intentional and not a bug in tests so that we avoid this build error
by adding -Wno-error=shadow

[  105s] kdbus-test.h:42:20: error: declaration of '_ASSERT_RETURN_VAL_val0_' shadows
a previous local [-Werror=shadow]
[  105s]    42 |  __auto_type const _ASSERT_RETURN_VAL_val0_ = (val0);\

Change-Id: Ia4f8a746dce0b39c896daf2e4cd1c87f62a8dadd
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years ago"Fix" var shadowing warnings in macros 41/270441/4
Michal Bloch [Thu, 3 Feb 2022 18:49:55 +0000 (19:49 +0100)]
"Fix" var shadowing warnings in macros

Introduce some horrible spaghetti code to "fix" var shadowing
in recursive macros which accept code referencing vars declared
inside the macro as arguments.

Change-Id: I426f060630010a0f8a5f1eaa642e2eef6100a26c

2 years agoFix shadowing in recursive ASSERT macros 39/270439/3
Michal Bloch [Wed, 2 Feb 2022 17:55:53 +0000 (18:55 +0100)]
Fix shadowing in recursive ASSERT macros

Change-Id: I509e0e481ba147fa5a29a0e1e83e6458dea41d5e

2 years agoFix some variable shadowing. 38/270438/3
Michal Bloch [Wed, 2 Feb 2022 17:55:23 +0000 (18:55 +0100)]
Fix some variable shadowing.

Change-Id: I1a6c0f0b51be5a7aa69455afe98ebdb21f5e0b3e

2 years agoFix further var shadowing 40/270440/3
Michal Bloch [Wed, 2 Feb 2022 18:03:04 +0000 (19:03 +0100)]
Fix further var shadowing

This macro is just used in one place so doesn't need counters.

Change-Id: I19991d02a9fa4915c87dc4803b0695778d9dad9e

2 years agoCast signed to unsigned explicitly 36/270436/2
Michal Bloch [Wed, 2 Feb 2022 18:57:42 +0000 (19:57 +0100)]
Cast signed to unsigned explicitly

Change-Id: I9500955d04398bc59206558d50f2917af44f783a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoFix disabling kdbus policy resulting in dead code 37/270437/1
Michal Bloch [Wed, 2 Feb 2022 18:29:22 +0000 (19:29 +0100)]
Fix disabling kdbus policy resulting in dead code

Change-Id: Ifb6357b7d4a4a35e9663df2c19ba25361485de14
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoRemove unnecessary local variable in kdbus tests 64/270264/1 submit/tizen/20220127.090529
Hyotaek Shim [Thu, 27 Jan 2022 08:25:22 +0000 (17:25 +0900)]
Remove unnecessary local variable in kdbus tests

[  230s] kdbus-test.c: In function 'main':
[  230s] kdbus-test.c:972:31: error: declaration of 't' shadows a previous local [-Werror=shadow]
[  230s]   972 |      const struct kdbus_test *t = &tests[i];
[  230s]       |                               ^
[  230s] kdbus-test.c:892:6: note: shadowed declaration is here
[  230s]   892 |  int t, ret = 0;
[  230s]       |      ^
[  230s] cc1: all warnings being treated as errors

Change-Id: I688feaa00630509363718f2d871adec3c2b951c7
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoUse memcpy for unknown destination buffer size 19/270219/2 submit/tizen/20220127.070935
Michal Bloch [Wed, 26 Jan 2022 16:01:55 +0000 (17:01 +0100)]
Use memcpy for unknown destination buffer size

Since we're using the source length instead
of destination size, use memcpy instead.

This is because the compiler realizes that this
should've been implemented via strcpy (without N)
and issues a warning, but then Tizen tools for
static analysis complain about regular strcpy.

Change-Id: I51b0b1e52bc221a972ac8863d3f82ac15f199dac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoFix a type signedness mismatch 18/270218/1
Michal Bloch [Wed, 26 Jan 2022 14:38:00 +0000 (15:38 +0100)]
Fix a type signedness mismatch

For size < 4, `char` was still cast to `unsigned` because of the earlier
operands, which also involved int promotion (so behaved the same as size == 4).

Change-Id: I7b9332bb20dd9d0035fc4607cb29a68cb82d0612
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoFix a useless shadowing var 17/270217/1
Michal Bloch [Wed, 26 Jan 2022 14:29:23 +0000 (15:29 +0100)]
Fix a useless shadowing var

Change-Id: Ief090ae6d4cdfba20281f285a1c62770e4433aa4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agologger: fix log->mutex + misc_mtx ab-ba deadlock 41/270041/1 accepted/tizen/unified/20220126.042654 submit/tizen/20220125.030100
Łukasz Stelmach [Mon, 24 Jan 2022 13:53:39 +0000 (14:53 +0100)]
logger: fix log->mutex + misc_mtx ab-ba deadlock

When a forked process reopens a file for stdio logging during the first write(2)
after a fork(2), it holds log->mutex when it calls filp_open() which
in turn calls misc_open(). misc_open() takes misc_mtx.

If at the same time (after acquiring log->mutex and before misc_open()
is called) another process (e.g. dlogutil) opens the same logger
device for reading (open(2) -> misc_open() -> logger_open() ->
mutex_lock(log->mutex)), a race condition and a AB-BA deadlock occurs. To
avoid it log->mutex is released before calling make_new_file() and
reaquired after. It is safe to do so, because the log structure isn't
accessed.

Change-Id: Ibaab2947638997dca82c0e47146f77ce0f1bee57
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: fix type mismatch on arm64 46/269946/2 submit/tizen/20220121.145113 submit/tizen/20220124.094500
Łukasz Stelmach [Fri, 21 Jan 2022 15:30:01 +0000 (16:30 +0100)]
logger: fix type mismatch on arm64

Change-Id: Iba4d8d53ed2c9244e6b4f2c87e626d001f42c629
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoRelease 7.0.6 39/269939/1
Łukasz Stelmach [Fri, 21 Jan 2022 14:42:32 +0000 (15:42 +0100)]
Release 7.0.6

Change-Id: Ie6042c435d4414f11a796abb69392dbb7146efed
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agopackaging: move logger-test out of unnececssary directory 37/269937/1
Łukasz Stelmach [Fri, 21 Jan 2022 14:25:54 +0000 (15:25 +0100)]
packaging: move logger-test out of unnececssary directory

Change-Id: Ib194ab911aa111f1c0f224c17df911d982aa9974
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agotests: kdbus: fix memory leak 42/269842/4
Łukasz Stelmach [Wed, 19 Jan 2022 19:02:16 +0000 (20:02 +0100)]
tests: kdbus: fix memory leak

Change-Id: I90606b1364825ed163f63d7597444aa6e7a8a6cd
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agotests: kdbus: fix memory leak 41/269841/4
Łukasz Stelmach [Wed, 19 Jan 2022 17:07:48 +0000 (18:07 +0100)]
tests: kdbus: fix memory leak

Change-Id: I7c061c3a55b661db3a31dd2fd4ded60e4b37df06
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agokdbus: Replace strcpy() with strncpy() 86/269586/6
Łukasz Stelmach [Tue, 18 Jan 2022 19:45:12 +0000 (20:45 +0100)]
kdbus: Replace strcpy() with strncpy()

Change-Id: Ie59bae03c5573e6a640998a6ae39f0753a98be95
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agokdbus: Replace strcat() with strncat() 83/269583/6
Łukasz Stelmach [Tue, 18 Jan 2022 14:25:31 +0000 (15:25 +0100)]
kdbus: Replace strcat() with strncat()

Change-Id: Ie8c68c7a48bcb359a2c8e649a96f7d538ed26ad8
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: make variable names match 33/269933/1
Łukasz Stelmach [Fri, 21 Jan 2022 13:02:56 +0000 (14:02 +0100)]
logger: make variable names match

Change-Id: Ibe70c2c0cba0a722259bae4cbe40dd865ac63448
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: configure log buffer sizes 52/269852/1
Łukasz Stelmach [Thu, 20 Jan 2022 14:43:55 +0000 (15:43 +0100)]
logger: configure log buffer sizes

Add module parameters main_buffer_size, events_buffer_size,
radio_buffer_size and system_buffer_size to configure respective buffer
sizes. If a parameter is set to zero respective buffer is not created
whatsoever.

Change-Id: Ibaf5fe152837ded0f31f924e81ea112d9d03b63e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: configure buffer size separately 50/269650/3
Łukasz Stelmach [Wed, 19 Jan 2022 13:39:20 +0000 (14:39 +0100)]
logger: configure buffer size separately

Add separate configuration for each buffer size.

Change-Id: If7134868996a20a8fd81a6bbfbe101bad6d21824
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: make buffer size configurable during compilation 22/269522/2
Łukasz Stelmach [Mon, 17 Jan 2022 20:58:58 +0000 (21:58 +0100)]
logger: make buffer size configurable during compilation

Change-Id: I5c50b4281cb1790248a39821c76f3ee874c76851
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: fix RPi4 timestamp issue 76/269576/1 accepted/tizen/unified/20220120.154525 submit/tizen/20220118.160313
Mateusz Majewski [Tue, 18 Jan 2022 10:45:59 +0000 (11:45 +0100)]
logger: fix RPi4 timestamp issue

Change-Id: Iaceffde5c5fb566a1481c2c8b48776e60057d811
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agoImport and build logger test 34/269234/2 accepted/tizen/unified/20220114.130106 submit/tizen/20220113.112544
Łukasz Stelmach [Mon, 10 Jan 2022 21:15:35 +0000 (22:15 +0100)]
Import and build logger test

Change-Id: Ibe00dad3ebd319875748c682a614fd517ebc8a4c
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoBuild and package kdbus tests 33/269233/2
Łukasz Stelmach [Tue, 4 Jan 2022 18:27:38 +0000 (19:27 +0100)]
Build and package kdbus tests

Change-Id: I797e79acf31e4e2e88f71430d7d570069850e819
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoImport kdbus test 32/269232/2
Mateusz Majewski [Mon, 6 Dec 2021 10:27:27 +0000 (11:27 +0100)]
Import kdbus test

Change-Id: I02d685dbb73055daebd5bed9640937ac05e33e35
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoRename the headers package 11/269311/1
Łukasz Stelmach [Wed, 12 Jan 2022 20:42:41 +0000 (21:42 +0100)]
Rename the headers package

Rename the output rpm containing logger.h and kdbus.h from
linux-tizen-modules-source-headers to linux-tizen-modules-headers since
the output rpm contains only headers and no other source code.

Change-Id: I9d471a074e48bdaaa382c06e935e0c4551516511
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoMove and export uapi headers 28/269228/1
Łukasz Stelmach [Wed, 5 Jan 2022 14:39:32 +0000 (15:39 +0100)]
Move and export uapi headers

Move logger.h and kdbus.h uapi headers to a separate directory
and export them to /usr/include/linux and
/usr/src/linux-tizen-modules-source.

Change-Id: Ie3fd39f44baf33552cc742f0c13228b1e87b9333
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoRelease 7.0.4 74/268974/1 submit/tizen/20220105.151434
Karol Lewandowski [Wed, 5 Jan 2022 13:18:10 +0000 (14:18 +0100)]
Release 7.0.4

This release adjusts logger.ko to be able to work with older (<3.18)
kernels.

Change-Id: I8230de61a67096b0dcadbe12fc5d34f68112b93e

2 years agoReplace copy_from_iter() with copy_from_user() 34/268734/4
Łukasz Stelmach [Thu, 16 Dec 2021 19:03:53 +0000 (20:03 +0100)]
Replace copy_from_iter() with copy_from_user()

iov_iter structure and associated function have been introduced in
v3.18. Logger needs use copy_from_user() and iterate over IO vectores
manualy.

Change-Id: Ifa46c67da65195611adc50b1dc6f0be66daac517
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoImport stdio handling code to logger_aio_write() 33/268733/4
Łukasz Stelmach [Wed, 15 Dec 2021 23:32:13 +0000 (00:32 +0100)]
Import stdio handling code to logger_aio_write()

Copy the stdio handling code from logger_write_iter()

Change-Id: I94be88c5db2e7482106ddd537d763726a89aad5a
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoDiscard data from stdio 32/268732/4
Łukasz Stelmach [Wed, 15 Dec 2021 23:28:34 +0000 (00:28 +0100)]
Discard data from stdio

Accept and discard unstructured data coming from stdio.

This commit is mainly to make the later changes more readable.

Change-Id: I0428eef0b3f9517e14b8de282003436e5296b66d
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoImport old logger_aio_write() 31/268731/4
Łukasz Stelmach [Wed, 15 Dec 2021 23:16:00 +0000 (00:16 +0100)]
Import old logger_aio_write()

Copy logger_aio_write() and two other functions from Android logger
driver in v3.10.65. Use them when compiling against old kernels.

Change-Id: I1e2cb304106e48ffad80f03dc7c9ae899cd228f4
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agokdbus: domain: drop overwritten assignment 98/268898/1 submit/tizen/20220104.143504
Karol Lewandowski [Tue, 4 Jan 2022 10:29:09 +0000 (11:29 +0100)]
kdbus: domain: drop overwritten assignment

Change-Id: Idf43dadcbee8156b1099f30dfd8ebc40c7c5bb45

2 years agopackaging: generate headers package 63/268763/3
Mateusz Majewski [Fri, 31 Dec 2021 09:19:43 +0000 (10:19 +0100)]
packaging: generate headers package

Change-Id: Icfd89649aeb8d723a7f70499cad16d361b83ee68
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agokdbus: use kdbus.h header from this repository 24/268724/1 accepted/tizen/unified/20211231.161252 submit/tizen/20211230.145232
Mateusz Majewski [Thu, 30 Dec 2021 09:43:47 +0000 (10:43 +0100)]
kdbus: use kdbus.h header from this repository

… as opposed to the header from the kernel headers package.

Change-Id: I25c86328cc16aba1099214802acb661291e31258
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agoBump version due to kdbus inclusion 50/267450/1 accepted/tizen/unified/20211208.121942 submit/tizen/20211206.151948
Karol Lewandowski [Fri, 3 Dec 2021 17:55:17 +0000 (18:55 +0100)]
Bump version due to kdbus inclusion

Other packages wanting kdbus might depend on particular version.

Change-Id: Iab701418f25314b5035d8ece0bfd95159b5daba6

2 years agoImport kdbus 43/267243/5
Mateusz Majewski [Tue, 30 Nov 2021 07:35:51 +0000 (08:35 +0100)]
Import kdbus

For the record, these files come from the
git://git.tizen.org/platform/kernel/linux-rpi.git repository, from the
be5781a07d48f8fd62633310fea57963aea1595d commit.

Change-Id: Ia3be026cf4a97fce32bbc98dc4151d75d670b186
Co-authored-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agoKeep only source package accepted/tizen/unified/20211126.111914 submit/tizen/20211126.100737
Karol Lewandowski [Fri, 26 Nov 2021 09:35:56 +0000 (10:35 +0100)]
Keep only source package

This commit drops all public-tizen customizations and keep only source
package generation.

Public Tizen linux-tizen-modules will use this package to build code
and will add its specific configuration.

Change-Id: I633f869530d6b0a34c27ff4d0d137bc7eaac262f

2 years agoAdd ability to not build all modules
Karol Lewandowski [Thu, 25 Nov 2021 11:35:51 +0000 (12:35 +0100)]
Add ability to not build all modules

This is going to be used by clients of -source package.

Change-Id: Ieb7be8aa0a169951356b554947a9ab978346346e

2 years agoAdd separate spec to build source package
Karol Lewandowski [Wed, 24 Nov 2021 15:15:36 +0000 (16:15 +0100)]
Add separate spec to build source package

Change-Id: I1e7850b6b7d959f9b36a85fceca11d5f0825971f

2 years agologger: handle error values from filp_open()
Łukasz Stelmach [Fri, 10 Sep 2021 18:02:53 +0000 (20:02 +0200)]
logger: handle error values from filp_open()

filp_open() may return -errno, so check for that instead of checking
for NULL.

Change-Id: I5a694555bcd082506330e08f48ed4b7043c4e120
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: flush data from stdio writers under mutex
Łukasz Stelmach [Wed, 15 Sep 2021 12:54:18 +0000 (14:54 +0200)]
logger: flush data from stdio writers under mutex

Operations during flushing logs delivered via stdio need to be performed
with the mutex held.

Change-Id: I4655b0af75172f8f22b797c0caadd28cb4619cf0
Suggested-by: Mateusz Majewski <m.majewski2@samsung.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agologger: flush remaining data from stdio writers on file release
Mateusz Majewski [Tue, 13 Jul 2021 09:47:15 +0000 (11:47 +0200)]
logger: flush remaining data from stdio writers on file release

Unlike logs from regular writers, logs from stdio writers are not
contained in a single write_iter call: if the last character written in
the call is not a newline, some of the input remains in the buffer for
the next write_iter call. This means that some data might remain in the
buffer during release, and such data has to be flushed; otherwise, it
would be lost.

Change-Id: I13c9dc020967fe8ef3fbcd52d45f85b8725d3c2c
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agologger: handle '\0's correctly in stdout writers
Mateusz Majewski [Tue, 13 Jul 2021 09:47:04 +0000 (11:47 +0200)]
logger: handle '\0's correctly in stdout writers

This commit takes care of cases when input received from stdout writers
contains '\0' characters. They should be treated like newlines. We
achieve this by simply replacing them by '\n's while searching for the
last '\n' in the input.

Change-Id: I51c23457f96bd6f0465d60da06157316756cc951
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
2 years agoSeparate configuration files for each target
INSUN PYO [Fri, 9 Jul 2021 03:24:14 +0000 (12:24 +0900)]
Separate configuration files for each target

Change-Id: Iaed004d48d4d0fad16d396ce95b26e37edb66ffb

2 years agoMerge branch 'stability-monitor-kmod-rpi3' into tizen
Karol Lewandowski [Wed, 7 Jul 2021 11:20:25 +0000 (13:20 +0200)]
Merge branch 'stability-monitor-kmod-rpi3' into tizen

This commit integrates previously standalone stability-monitor-kmod-rpi3
into this repository.

Source commit 901f4d0ec2 ("Support Linux kernel v5.10") has been downloaded by:

   git fetch ssh://klewandowski@review.tizen.org:29418/platform/core/system/stability-monitor-kmod-rpi3 refs/changes/90/253890/1 && git checkout FETCH_HEAD

Change-Id: I3ee19411f8c2af86776e9796491857ff88e3baed

2 years agologger: enable logger module
INSUN PYO [Fri, 25 Jun 2021 04:38:56 +0000 (13:38 +0900)]
logger: enable logger module

Change-Id: If186dc62a39a360b42b99cea0f8e4c29940c71db

2 years agopackaging: fix not to set kernel symbol dependency automatically
INSUN PYO [Thu, 24 Jun 2021 06:47:47 +0000 (15:47 +0900)]
packaging: fix not to set kernel symbol dependency automatically

Kernel image rpm does not have kerenl symbol provides, so kernel
symbol automatically checked dependency from kernel module breaks
install dependency. Fix not to run automatical dependency check.

Change-Id: If5a6de3c97205e011dcd91d3358563e3e261560d

2 years agoApply depmod postscript
INSUN PYO [Fri, 18 Jun 2021 06:49:20 +0000 (15:49 +0900)]
Apply depmod postscript

To use modprobe, module name is requires on /lib/modules/version/modules.dep.

Change-Id: I4ac1e90424f2707675f9fce37544c193de6afaf4
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoResolve conflict with /lib/modules when using baselibs
Hyotaek Shim [Wed, 23 Jun 2021 01:15:47 +0000 (10:15 +0900)]
Resolve conflict with /lib/modules when using baselibs

In tw3 images, kernel is based on 64bit while platform is on 32bit.
Thanks to baselibs, aarch64 rpms containing tw3 kernel modules can be repackaged to arm rpms.

$ rpm -ql linux-tizen-modules-tw3-aarch64-6.5.0-0.armv7l.rpm
/lib/modules
/lib/modules/4.9.59
/lib/modules/4.9.59/extra
/lib/modules/4.9.59/extra/logger.ko

Unfortunately, however, /lib/modules, which is implicitly packaged,
is conflict with filesystem package.

INFO: Next install: filesystem
WARNING: file /lib/modules conflicts between attempted installs of
linux-tizen-modules-tw3-aarch64-6.5.0-1.1.armv7l and filesystem-3.1-3.3.armv7l
ERROR: Could not run transaction.

This patch avoids generating /lib/modules in the linux-tizen-modules-tw3-aarch64.armv7l.rpm

Change-Id: I8be870f9999e1e2f626c99bae7bced3ac623d44d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agologger: exclude /lib/module directory from tw3 baselib
INSUN PYO [Thu, 17 Jun 2021 08:47:21 +0000 (17:47 +0900)]
logger: exclude /lib/module directory from tw3 baselib

The baselibs adds paths recursively.
(ie. for /a/b/c, and cofiguration +/a/b/c, the baselibs will add /a, /a/b and then /a/b/c)

So, temporarily remove /lib/module until a solution is found.

=== original rpm ======================================================
linux-tizen-modules-tw3-6.5.0-0.aarch64.rpm
 - /lib/modules/4.9.59/extra
 - /lib/modules/4.9.59/extra/logger.ko
 - /usr/share/licenses/linux-tizen-modules-tw3
 - /usr/share/licenses/linux-tizen-modules-tw3/COPYING

=== baselib rpm ======================================================
linux-tizen-modules-tw3-aarch64-6.5.0-0.armv7l.rpm
 - /lib/modules
 - /lib/modules/4.9.59
 - /lib/modules/4.9.59/extra
 - /lib/modules/4.9.59/extra/logger.ko
 - /usr/share/licenses
 - /usr/share/licenses/linux-tizen-modules-tw3

Change-Id: I6ee6076f2b4247f335c2ca54639b6bf27907a3c1

3 years agopackaging: Support logger driver for rpi3, rpi4 and tw3 kernels
Karol Lewandowski [Thu, 22 Apr 2021 13:58:39 +0000 (15:58 +0200)]
packaging: Support logger driver for rpi3, rpi4 and tw3 kernels

Change-Id: I41eba922c16b34efe04e7d15896e7fe9ad6012ca

3 years agoMerge branch 'logger-linux-rpi3' into tizen
Karol Lewandowski [Thu, 22 Apr 2021 13:51:37 +0000 (15:51 +0200)]
Merge branch 'logger-linux-rpi3' into tizen

This imports logger driver along with history. It's been obtained from:

  ssh://review.tizen.org:29418/platform/kernel/linux-rpi3

Change-Id: If7ffcb064bd6c8279a0cceb285f1db372aa22907

3 years agologger: introduce struct logger_set_tag
Łukasz Stelmach [Wed, 14 Apr 2021 15:50:51 +0000 (17:50 +0200)]
logger: introduce struct logger_set_tag

Introduce dedicated structure for LOGGER_SET_TAG ioctl,
instead of packing and unpacking arguments by hand.

Change-Id: Ic3399ab37f55ba2b8a9a976f8c9495fc487fe7f3
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agologger: move logger.h to uapi
Łukasz Stelmach [Fri, 19 Mar 2021 14:20:06 +0000 (15:20 +0100)]
logger: move logger.h to uapi

Move logger.h to uapi so it can be exported for userland
software to use.

Change-Id: I64dca69f3442edc246562485b0b29b43615ae881
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agologger: return amount of data written to stdio
Łukasz Stelmach [Tue, 13 Apr 2021 10:24:38 +0000 (12:24 +0200)]
logger: return amount of data written to stdio

Return amount of data written by a process to a logger via STDIO
interface.

Change-Id: I9c77a312d09f3d796a7ec64d5909af193bcc8bc2
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agologger: fix temporary buffer handling
Łukasz Stelmach [Fri, 9 Apr 2021 15:20:07 +0000 (17:20 +0200)]
logger: fix temporary buffer handling

Prevent writing beyond temporary buffer and improve accumulation of data
before receiving a newline character or filling the buffer.

Change-Id: I8e0591c90914dbd4c2addde4247157831fa4843a
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agologger: adapt access mode checks
Łukasz Stelmach [Fri, 9 Apr 2021 14:59:56 +0000 (16:59 +0200)]
logger: adapt access mode checks

Allow setting the tag and the priority only for files opened O_WRONLY.

Change-Id: Icc9d7a8eb96f8f1b1aa00717aae1f32f7a2e52e4
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agologger: Fix incorrect buffer access when writing data
Łukasz Stelmach [Thu, 8 Apr 2021 12:09:24 +0000 (14:09 +0200)]
logger: Fix incorrect buffer access when writing data

Fix crash caused by accessing memory beyond log->buffer

Change-Id: I528b62e34e9fb5f92f62f6b218718e15cd5f7d31
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agologger: accept untagged log entries
Łukasz Stelmach [Fri, 12 Feb 2021 17:41:09 +0000 (18:41 +0100)]
logger: accept untagged log entries

Add support for writing untagged log messages to /dev/log_* nodes. The
logger shall accept untagget messages after setting the tag and
the priority with appropriate ioctl() commands for particular file
descriptors.

Change-Id: I02bd7bfd843eaf316692413a48747009c42756f6
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agostaging: logger: fix build error due to removed ki_nbytes
Inki Dae [Mon, 4 Jul 2016 08:28:46 +0000 (17:28 +0900)]
staging: logger: fix build error due to removed ki_nbytes

This patch fixes build error. Logger driver was removed
from mainline kernel and after that there was some changes and
one of them is that ki_nbytes member was removed from kiocb structure.
66ee59a fs: remove ki_nbytes

This patch makes count member of iov_iter structure to be used instead.

Change-Id: I11e9ebdac7dd86c02fd692a67562a23e5c685f69
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agostaging: android: logger: fix the compiler error
Jaehoon Chung [Fri, 5 Jan 2018 00:40:02 +0000 (09:40 +0900)]
staging: android: logger: fix the compiler error

Moved signal wakeup & sigpending methods from <linux/sched.h> into
<linux/sched/signal.h>.

Refer to commit 174cd4b1e5fb (sched/headers: Prepare to move signal
wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>

Fix the compiler error about android logger.

Change-Id: Iab1583fe54fef1c76a34673d1d718f73930baa11
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agostaging: android: Correct coding style in logger.c
Guillaume Vercoutere [Mon, 5 Jan 2015 14:24:06 +0000 (15:24 +0100)]
staging: android: Correct coding style in logger.c

Correct intent and missing space

Signed-off-by: Guillaume Vercoutere <gvercoutere@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: Fix log corruption regression
Daniel Thompson [Mon, 27 Oct 2014 18:51:43 +0000 (18:51 +0000)]
staging: android: logger: Fix log corruption regression

Since commit cd678fce4280 ("switch logger to ->write_iter()"), any
attempt to write to the log results in the log data being written over
its own metadata, thus rendering the log unreadable.

The problem was first detected when I ran an Android userspace on the
v3.18-rc1 kernel. However the issue can also be observed with a
non-Android userspace by using echo/cat to write to/from /dev/log_main .

This patch resolves the problem by using a temporary to track the status
of not-yet-committed writes to the log buffer.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
3 years agoswitch logger to ->write_iter()
Al Viro [Sat, 23 Aug 2014 16:20:37 +0000 (12:20 -0400)]
switch logger to ->write_iter()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
3 years agostaging: android: fix a possible memory leak
Seunghun Lee [Wed, 13 Aug 2014 17:02:48 +0000 (02:02 +0900)]
staging: android: fix a possible memory leak

Memory allocated by kstrdup should be freed.

CC: Brian Swetland <swetland@google.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: fixed checkpatch.pl warnings.
Jerry Stralko [Tue, 1 Jul 2014 11:13:18 +0000 (07:13 -0400)]
staging: android: logger: fixed checkpatch.pl warnings.

Signed-off-by: Jerry Stralko <gerb.stralko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: fix missing a blank line after declarations
Seunghun Lee [Wed, 30 Apr 2014 16:30:23 +0000 (01:30 +0900)]
staging: android: fix missing a blank line after declarations

This patch fixes "Missing a blank line after declarations" warnings.

Change-Id: I67708f8839f3a6d7ab26782ab2f0e4574325ff65
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agoaio: Kill aio_rw_vect_retry()
Kent Overstreet [Thu, 9 May 2013 22:03:42 +0000 (15:03 -0700)]
aio: Kill aio_rw_vect_retry()

This code doesn't serve any purpose anymore, since the aio retry
infrastructure has been removed.

This change should be safe because aio_read/write are also used for
synchronous IO, and called from do_sync_read()/do_sync_write() - and
there's no looping done in the sync case (the read and write syscalls).

Change-Id: I29e2981ea74ef69bb7803fb138d8a5f7e58eeb7b
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: Zach Brown <zab@redhat.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
3 years agostaging: android: logger: Correct write offset reset on error
Karlis Ogsts [Mon, 22 Jul 2013 20:51:42 +0000 (13:51 -0700)]
staging: android: logger: Correct write offset reset on error

In the situation that a writer fails to copy data from userspace it will reset
the write offset to the value it had before it went to sleep. This discarding
any messages written while aquiring the mutex.

Therefore the reset offset needs to be retrieved after acquiring the mutex.

Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agomore open-coded file_inode() calls
Al Viro [Sun, 16 Jun 2013 13:25:12 +0000 (17:25 +0400)]
more open-coded file_inode() calls

Change-Id: I7dd013afbccd5fd3ec2328829bb1cdbf634d84cf
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agostaging: android: logger: use kuid_t instead of uid_t
Xiong Zhou [Wed, 8 May 2013 10:52:48 +0000 (18:52 +0800)]
staging: android: logger: use kuid_t instead of uid_t

Use kuid_t instead of uid_t, to pass the UIDGID_STRICT_TYPE_CHECKS.

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoaio: don't include aio.h in sched.h
Kent Overstreet [Tue, 7 May 2013 23:19:08 +0000 (16:19 -0700)]
aio: don't include aio.h in sched.h

Faster kernel compiles by way of fewer unnecessary includes.

[akpm@linux-foundation.org: fix fallout]
[akpm@linux-foundation.org: fix build]
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: Zach Brown <zab@redhat.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Change-Id: Ifc9abc94955466ddd797c107fc05116d50bd72d2

3 years agostaging: android: logger: enforce GID and CAP check on log flush
Charndeep Grewal [Wed, 27 Feb 2013 06:07:38 +0000 (22:07 -0800)]
staging: android: logger: enforce GID and CAP check on log flush

Restrict log flushing to those in the logs group, or
anyone with CAP_SYSLOG.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Charndeep Grewal <csgrewa@tycho.ncsc.mil>
Signed-off-by: Charndeep Grewal <csgrewa@tycho.ncsc.mil>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: Allow a UID to read it's own log entries
Nick Kralevich [Wed, 27 Feb 2013 06:07:37 +0000 (22:07 -0800)]
staging: android: logger: Allow a UID to read it's own log entries

Modify the kernel logger to record the UID associated with
the log entries. Always allow the same UID which generated a
log message to read the log message.

Allow anyone in the logs group, or anyone with CAP_SYSLOG, to
read all log entries.

In addition, allow the client to upgrade log formats, so they
can get additional information from the kernel.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Nick Kralevich <nnk@google.com>
Signed-off-by: Nick Kralevich <nnk@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger.h: Complete documentation of logger_entry
Cruz Julian Bishop [Wed, 1 Aug 2012 04:54:17 +0000 (14:54 +1000)]
staging: android: logger.h: Complete documentation of logger_entry

Previously, there were simply comments after each part - Now, it is
completed properly according to "Kernel doc" Sorry in advance if I made
any mistakes.

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoStaging: Android: logger: module_exit implementation
Luca Clementi [Thu, 22 Nov 2012 03:43:17 +0000 (19:43 -0800)]
Staging: Android: logger: module_exit implementation

This patch creates the module_exit for the android logger
so that it can be loaded and unloaded as a module.

The android logger is already declared as a tristate in the
Kconfig but the module_exit function was missing.

device_initcall works also with modprobe since include/linux/init.h:

 #define module_init(x)  __initcall(x);
 ...
 #define __initcall(fn) device_initcall(fn)

Tested against f4a75d2eb7b1e2206094b901be09adb31ba63681 Linux 3.7-rc6

Signed-off-by: Luca Clementi <luca.clementi@gmail.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Robert Love <rlove@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: Finish documentation of two structs
Cruz Julian Bishop [Wed, 1 Aug 2012 04:54:18 +0000 (14:54 +1000)]
staging: android: logger: Finish documentation of two structs

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: Android: Fix some checkpatch warnings
Sachin Kamat [Tue, 5 Jun 2012 11:10:10 +0000 (16:40 +0530)]
staging: Android: Fix some checkpatch warnings

Warnings reported by checkpatch.pl have been fixed.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Pick only changes in logger.[ch] while moving code out of tree ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Change-Id: I5e611019438fe798ff1eef2bd25412dc4a764124

3 years agostaging: android: logger: Fix some sparse and whitespace issues
Tim Bird [Thu, 10 May 2012 21:22:59 +0000 (14:22 -0700)]
staging: android: logger: Fix some sparse and whitespace issues

Fix a few sparse warnings, and improve whitespace.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: Allocate logs dynamically at boot (v3)
Tim Bird [Thu, 10 May 2012 22:11:36 +0000 (15:11 -0700)]
staging: android: logger: Allocate logs dynamically at boot (v3)

This changes the log initialization to be dynamic, but still
at boot time.  These changes are a predecessor to implementing
runtime allocation and freeing of logs, to make the Android logger
less hard-coded.

Change from a fixed set of static log structures, to allocation
at init time into a list.  Return proper error numbers on log
allocation failure.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: logger: hold mutex while removing reader
Rabin Vincent [Wed, 22 Feb 2012 10:28:00 +0000 (15:58 +0530)]
staging: logger: hold mutex while removing reader

The readers list is traversed under the log->mutex lock
(for example from fix_up_readers()), but the deletion of
elements from this list is not being done under this lock.

Cc: Brian Swetland <swetland@google.com>
Cc: Dima Zavin <dima@android.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: clarify non-update of w_off in do_write_log_from_user
Tim Bird [Wed, 8 Feb 2012 02:34:28 +0000 (18:34 -0800)]
staging: android: logger: clarify non-update of w_off in do_write_log_from_user

Add comment to explain when w_off is not updated in case of failed second
fragment copy to buffer.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: clarify code in clock_interval
Tim Bird [Wed, 8 Feb 2012 02:32:02 +0000 (18:32 -0800)]
staging: android: logger: clarify code in clock_interval

Add commentary, rename the function and make the code easier to read.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: reorder prepare_to_wait and mutex_lock
Tim Bird [Wed, 8 Feb 2012 02:30:09 +0000 (18:30 -0800)]
staging: android: logger: reorder prepare_to_wait and mutex_lock

If mutex_lock waits, it will return in state TASK_RUNNING,
rubbing out the effect of prepare_to_wait().

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: simplify and optimize get_entry_len
Tim Bird [Wed, 8 Feb 2012 18:37:57 +0000 (10:37 -0800)]
staging: android: logger: simplify and optimize get_entry_len

Make this code slightly easier to read, and eliminate calls
to sub-routines.  Some of these were previously optimized away
by the compiler, but one memcpy was not.

In my testing, this makes the code about 20% smaller, and
has no sub-routine calls and no branches (on ARM).

v2 of this patch is, IMHO, easier to read than v1. Compared to
that patch it uses __u8 instead of unsigned char, for
consistency with the __u16 val data type, simplifies the
conditional expression, adds a another comment, and
moves a common statement out of the if.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: android: logger: Change logger_offset() from macro to function
Tim Bird [Wed, 8 Feb 2012 02:26:38 +0000 (18:26 -0800)]
staging: android: logger: Change logger_offset() from macro to function

Convert to function and add log as a parameter, rather than relying
on log in the context of the macro.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoStaging: android: fixed white spaces coding style issue in logger.c
Marco Navarra [Thu, 15 Dec 2011 16:57:48 +0000 (17:57 +0100)]
Staging: android: fixed white spaces coding style issue in logger.c

This patch fixes some space-before-tabs warnings found by checkpatch tool on the staging android driver file logger.c

Signed-off-by: Marco Navarra <fromenglish@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3 years agoandroid: logger: bump up the logger buffer sizes
JP Abgrall [Fri, 12 Aug 2011 04:33:35 +0000 (21:33 -0700)]
android: logger: bump up the logger buffer sizes

(port from common android-2.6.39
  commit: 11430f16545205c614dd5bd58e4a7ee630fc0f9f)

events: (no change, 256)
main: 64 -> 256
radio: 64 -> 256
system: 64 -> 256

Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3 years agoandroid: logger: Add new system log for framework/system log messages
San Mehat [Wed, 24 Feb 2010 00:09:47 +0000 (16:09 -0800)]
android: logger: Add new system log for framework/system log messages

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>