@cryptotaxi247 / netdata-1 / commits / d0e4ce57d

fixed typo in kernel_uint_t

Costa Tsaousis (ktsaou) committed Jan 29, 2017 at 18:48 UTC d0e4ce57d445d87486d9f85b4623bac61126493d
3 files changed +76 -76
src/apps_plugin.c
+58 -58
@@ -764,79 +764,79 @@ static inline int read_proc_pid_stat(struct pid_stat *p) {
764
765 // p->state = *(procfile_lineword(ff, 0, 2));
766 p->ppid = (int32_t)str2pid_t(procfile_lineword(ff, 0, 3));
767 - // p->pgrp = str2ul(procfile_lineword(ff, 0, 4));
768 - // p->session = str2ul(procfile_lineword(ff, 0, 5));
769 - // p->tty_nr = str2ul(procfile_lineword(ff, 0, 6));
770 - // p->tpgid = str2ul(procfile_lineword(ff, 0, 7));
771 - // p->flags = str2ull(procfile_lineword(ff, 0, 8));
767 + // p->pgrp = (int32_t)str2pid_t(procfile_lineword(ff, 0, 4));
768 + // p->session = (int32_t)str2pid_t(procfile_lineword(ff, 0, 5));
769 + // p->tty_nr = (int32_t)str2pid_t(procfile_lineword(ff, 0, 6));
770 + // p->tpgid = (int32_t)str2pid_t(procfile_lineword(ff, 0, 7));
771 + // p->flags = str2uint64_t(procfile_lineword(ff, 0, 8));
772
773 kernel_uint_t last;
774
775 last = p->minflt_raw;
776 - p->minflt_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 9));
776 + p->minflt_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 9));
777 p->minflt = (p->minflt_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
778
779 last = p->cminflt_raw;
780 - p->cminflt_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 10));
780 + p->cminflt_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 10));
781 p->cminflt = (p->cminflt_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
782
783 last = p->majflt_raw;
784 - p->majflt_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 11));
784 + p->majflt_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 11));
785 p->majflt = (p->majflt_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
786
787 last = p->cmajflt_raw;
788 - p->cmajflt_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 12));
788 + p->cmajflt_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 12));
789 p->cmajflt = (p->cmajflt_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
790
791 last = p->utime_raw;
792 - p->utime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 13));
792 + p->utime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 13));
793 p->utime = (p->utime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
794
795 last = p->stime_raw;
796 - p->stime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 14));
796 + p->stime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 14));
797 p->stime = (p->stime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
798
799 last = p->cutime_raw;
800 - p->cutime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 15));
800 + p->cutime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 15));
801 p->cutime = (p->cutime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
802
803 last = p->cstime_raw;
804 - p->cstime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 16));
804 + p->cstime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 16));
805 p->cstime = (p->cstime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
806
807 - // p->priority = str2kernel_unit_t(procfile_lineword(ff, 0, 17));
808 - // p->nice = str2kernel_unit_t(procfile_lineword(ff, 0, 18));
807 + // p->priority = str2kernel_uint_t(procfile_lineword(ff, 0, 17));
808 + // p->nice = str2kernel_uint_t(procfile_lineword(ff, 0, 18));
809 p->num_threads = (int32_t)str2uint32_t(procfile_lineword(ff, 0, 19));
810 - // p->itrealvalue = str2kernel_unit_t(procfile_lineword(ff, 0, 20));
811 - // p->starttime = str2kernel_unit_t(procfile_lineword(ff, 0, 21));
812 - // p->vsize = str2kernel_unit_t(procfile_lineword(ff, 0, 22));
813 - // p->rss = str2kernel_unit_t(procfile_lineword(ff, 0, 23));
814 - // p->rsslim = str2kernel_unit_t(procfile_lineword(ff, 0, 24));
815 - // p->starcode = str2kernel_unit_t(procfile_lineword(ff, 0, 25));
816 - // p->endcode = str2kernel_unit_t(procfile_lineword(ff, 0, 26));
817 - // p->startstack = str2kernel_unit_t(procfile_lineword(ff, 0, 27));
818 - // p->kstkesp = str2kernel_unit_t(procfile_lineword(ff, 0, 28));
819 - // p->kstkeip = str2kernel_unit_t(procfile_lineword(ff, 0, 29));
820 - // p->signal = str2kernel_unit_t(procfile_lineword(ff, 0, 30));
821 - // p->blocked = str2kernel_unit_t(procfile_lineword(ff, 0, 31));
822 - // p->sigignore = str2kernel_unit_t(procfile_lineword(ff, 0, 32));
823 - // p->sigcatch = str2kernel_unit_t(procfile_lineword(ff, 0, 33));
824 - // p->wchan = str2kernel_unit_t(procfile_lineword(ff, 0, 34));
825 - // p->nswap = str2kernel_unit_t(procfile_lineword(ff, 0, 35));
826 - // p->cnswap = str2kernel_unit_t(procfile_lineword(ff, 0, 36));
827 - // p->exit_signal = str2kernel_unit_t(procfile_lineword(ff, 0, 37));
828 - // p->processor = str2kernel_unit_t(procfile_lineword(ff, 0, 38));
829 - // p->rt_priority = str2kernel_unit_t(procfile_lineword(ff, 0, 39));
830 - // p->policy = str2kernel_unit_t(procfile_lineword(ff, 0, 40));
831 - // p->delayacct_blkio_ticks = str2kernel_unit_t(procfile_lineword(ff, 0, 41));
810 + // p->itrealvalue = str2kernel_uint_t(procfile_lineword(ff, 0, 20));
811 + // p->starttime = str2kernel_uint_t(procfile_lineword(ff, 0, 21));
812 + // p->vsize = str2kernel_uint_t(procfile_lineword(ff, 0, 22));
813 + // p->rss = str2kernel_uint_t(procfile_lineword(ff, 0, 23));
814 + // p->rsslim = str2kernel_uint_t(procfile_lineword(ff, 0, 24));
815 + // p->starcode = str2kernel_uint_t(procfile_lineword(ff, 0, 25));
816 + // p->endcode = str2kernel_uint_t(procfile_lineword(ff, 0, 26));
817 + // p->startstack = str2kernel_uint_t(procfile_lineword(ff, 0, 27));
818 + // p->kstkesp = str2kernel_uint_t(procfile_lineword(ff, 0, 28));
819 + // p->kstkeip = str2kernel_uint_t(procfile_lineword(ff, 0, 29));
820 + // p->signal = str2kernel_uint_t(procfile_lineword(ff, 0, 30));
821 + // p->blocked = str2kernel_uint_t(procfile_lineword(ff, 0, 31));
822 + // p->sigignore = str2kernel_uint_t(procfile_lineword(ff, 0, 32));
823 + // p->sigcatch = str2kernel_uint_t(procfile_lineword(ff, 0, 33));
824 + // p->wchan = str2kernel_uint_t(procfile_lineword(ff, 0, 34));
825 + // p->nswap = str2kernel_uint_t(procfile_lineword(ff, 0, 35));
826 + // p->cnswap = str2kernel_uint_t(procfile_lineword(ff, 0, 36));
827 + // p->exit_signal = str2kernel_uint_t(procfile_lineword(ff, 0, 37));
828 + // p->processor = str2kernel_uint_t(procfile_lineword(ff, 0, 38));
829 + // p->rt_priority = str2kernel_uint_t(procfile_lineword(ff, 0, 39));
830 + // p->policy = str2kernel_uint_t(procfile_lineword(ff, 0, 40));
831 + // p->delayacct_blkio_ticks = str2kernel_uint_t(procfile_lineword(ff, 0, 41));
832
833 if(enable_guest_charts) {
834 last = p->gtime_raw;
835 - p->gtime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 42));
835 + p->gtime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 42));
836 p->gtime = (p->gtime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
837
838 last = p->cgtime_raw;
839 - p->cgtime_raw = str2kernel_unit_t(procfile_lineword(ff, 0, 43));
839 + p->cgtime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 43));
840 p->cgtime = (p->cgtime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->stat_collected_usec - p->last_stat_collected_usec);
841
842 if (show_guest_time || p->gtime || p->cgtime) {
@@ -897,13 +897,13 @@ static inline int read_proc_pid_statm(struct pid_stat *p) {
897
898 file_counter++;
899
900 - p->statm_size = str2ull(procfile_lineword(ff, 0, 0));
901 - p->statm_resident = str2ull(procfile_lineword(ff, 0, 1));
902 - p->statm_share = str2ull(procfile_lineword(ff, 0, 2));
903 - // p->statm_text = str2ull(procfile_lineword(ff, 0, 3));
904 - // p->statm_lib = str2ull(procfile_lineword(ff, 0, 4));
905 - // p->statm_data = str2ull(procfile_lineword(ff, 0, 5));
906 - // p->statm_dirty = str2ull(procfile_lineword(ff, 0, 6));
900 + p->statm_size = str2kernel_uint_t(procfile_lineword(ff, 0, 0));
901 + p->statm_resident = str2kernel_uint_t(procfile_lineword(ff, 0, 1));
902 + p->statm_share = str2kernel_uint_t(procfile_lineword(ff, 0, 2));
903 + // p->statm_text = str2kernel_uint_t(procfile_lineword(ff, 0, 3));
904 + // p->statm_lib = str2kernel_uint_t(procfile_lineword(ff, 0, 4));
905 + // p->statm_data = str2kernel_uint_t(procfile_lineword(ff, 0, 5));
906 + // p->statm_dirty = str2kernel_uint_t(procfile_lineword(ff, 0, 6));
907
908 return 1;
909
@@ -942,31 +942,31 @@ static inline int read_proc_pid_io(struct pid_stat *p) {
942 kernel_uint_t last;
943
944 last = p->io_logical_bytes_read_raw;
945 - p->io_logical_bytes_read_raw = str2ull(procfile_lineword(ff, 0, 1));
945 + p->io_logical_bytes_read_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 1));
946 p->io_logical_bytes_read = (p->io_logical_bytes_read_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
947
948 last = p->io_logical_bytes_written_raw;
949 - p->io_logical_bytes_written_raw = str2ull(procfile_lineword(ff, 1, 1));
949 + p->io_logical_bytes_written_raw = str2kernel_uint_t(procfile_lineword(ff, 1, 1));
950 p->io_logical_bytes_written = (p->io_logical_bytes_written_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
951
952 // last = p->io_read_calls_raw;
953 - // p->io_read_calls_raw = str2ull(procfile_lineword(ff, 2, 1));
953 + // p->io_read_calls_raw = str2kernel_uint_t(procfile_lineword(ff, 2, 1));
954 // p->io_read_calls = (p->io_read_calls_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
955
956 // last = p->io_write_calls_raw;
957 - // p->io_write_calls_raw = str2ull(procfile_lineword(ff, 3, 1));
957 + // p->io_write_calls_raw = str2kernel_uint_t(procfile_lineword(ff, 3, 1));
958 // p->io_write_calls = (p->io_write_calls_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
959
960 last = p->io_storage_bytes_read_raw;
961 - p->io_storage_bytes_read_raw = str2ull(procfile_lineword(ff, 4, 1));
961 + p->io_storage_bytes_read_raw = str2kernel_uint_t(procfile_lineword(ff, 4, 1));
962 p->io_storage_bytes_read = (p->io_storage_bytes_read_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
963
964 last = p->io_storage_bytes_written_raw;
965 - p->io_storage_bytes_written_raw = str2ull(procfile_lineword(ff, 5, 1));
965 + p->io_storage_bytes_written_raw = str2kernel_uint_t(procfile_lineword(ff, 5, 1));
966 p->io_storage_bytes_written = (p->io_storage_bytes_written_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
967
968 // last = p->io_cancelled_write_bytes_raw;
969 - // p->io_cancelled_write_bytes_raw = str2ull(procfile_lineword(ff, 6, 1));
969 + // p->io_cancelled_write_bytes_raw = str2kernel_uint_t(procfile_lineword(ff, 6, 1));
970 // p->io_cancelled_write_bytes = (p->io_cancelled_write_bytes_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (p->io_collected_usec - p->last_io_collected_usec);
971
972 if(unlikely(global_iterations_counter == 1)) {
@@ -1015,26 +1015,26 @@ static inline int read_proc_stat() {
1015 kernel_uint_t last;
1016
1017 last = utime_raw;
1018 - utime_raw = str2ull(procfile_lineword(ff, 0, 1));
1018 + utime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 1));
1019 global_utime = (utime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (collected_usec - last_collected_usec);
1020
1021 // nice time, on user time
1022 last = ntime_raw;
1023 - ntime_raw = str2ull(procfile_lineword(ff, 0, 2));
1023 + ntime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 2));
1024 global_utime += (ntime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (collected_usec - last_collected_usec);
1025
1026 last = stime_raw;
1027 - stime_raw = str2ull(procfile_lineword(ff, 0, 3));
1027 + stime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 3));
1028 global_stime = (stime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (collected_usec - last_collected_usec);
1029
1030 last = gtime_raw;
1031 - gtime_raw = str2ull(procfile_lineword(ff, 0, 10));
1031 + gtime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 10));
1032 global_gtime = (gtime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (collected_usec - last_collected_usec);
1033
1034 if(enable_guest_charts) {
1035 // guest nice time, on guest time
1036 last = gntime_raw;
1037 - gntime_raw = str2ull(procfile_lineword(ff, 0, 11));
1037 + gntime_raw = str2kernel_uint_t(procfile_lineword(ff, 0, 11));
1038 global_gtime += (gntime_raw - last) * (USEC_PER_SEC * RATES_DETAIL) / (collected_usec - last_collected_usec);
1039
1040 // remove guest time from user time
src/inlined.h
+2 -2
@@ -5,11 +5,11 @@
5
6 #ifdef KERNEL_32BIT
7 typedef uint32_t kernel_uint_t;
8 -#define str2kernel_unit_t(string) str2uint32_t(string)
8 +#define str2kernel_uint_t(string) str2uint32_t(string)
9 #define KERNEL_UINT_FORMAT "%u"
10 #else
11 typedef uint64_t kernel_uint_t;
12 -#define str2kernel_unit_t(string) str2uint64_t(string)
12 +#define str2kernel_uint_t(string) str2uint64_t(string)
13 #define KERNEL_UINT_FORMAT "%" PRIu64
14 #endif
15
src/proc_net_dev.c
+16 -16
@@ -180,40 +180,40 @@ int do_proc_net_dev(int update_every, usec_t dt) {
180 continue;
181
182 if(likely(d->do_bandwidth != CONFIG_ONDEMAND_NO)) {
183 - d->rbytes = str2kernel_unit_t(procfile_lineword(ff, l, 1));
184 - d->tbytes = str2kernel_unit_t(procfile_lineword(ff, l, 9));
183 + d->rbytes = str2kernel_uint_t(procfile_lineword(ff, l, 1));
184 + d->tbytes = str2kernel_uint_t(procfile_lineword(ff, l, 9));
185 }
186
187 if(likely(d->do_packets != CONFIG_ONDEMAND_NO)) {
188 - d->rpackets = str2kernel_unit_t(procfile_lineword(ff, l, 2));
189 - d->rmulticast = str2kernel_unit_t(procfile_lineword(ff, l, 8));
190 - d->tpackets = str2kernel_unit_t(procfile_lineword(ff, l, 10));
188 + d->rpackets = str2kernel_uint_t(procfile_lineword(ff, l, 2));
189 + d->rmulticast = str2kernel_uint_t(procfile_lineword(ff, l, 8));
190 + d->tpackets = str2kernel_uint_t(procfile_lineword(ff, l, 10));
191 }
192
193 if(likely(d->do_errors != CONFIG_ONDEMAND_NO)) {
194 - d->rerrors = str2kernel_unit_t(procfile_lineword(ff, l, 3));
195 - d->terrors = str2kernel_unit_t(procfile_lineword(ff, l, 11));
194 + d->rerrors = str2kernel_uint_t(procfile_lineword(ff, l, 3));
195 + d->terrors = str2kernel_uint_t(procfile_lineword(ff, l, 11));
196 }
197
198 if(likely(d->do_drops != CONFIG_ONDEMAND_NO)) {
199 - d->rdrops = str2kernel_unit_t(procfile_lineword(ff, l, 4));
200 - d->tdrops = str2kernel_unit_t(procfile_lineword(ff, l, 12));
199 + d->rdrops = str2kernel_uint_t(procfile_lineword(ff, l, 4));
200 + d->tdrops = str2kernel_uint_t(procfile_lineword(ff, l, 12));
201 }
202
203 if(likely(d->do_fifo != CONFIG_ONDEMAND_NO)) {
204 - d->rfifo = str2kernel_unit_t(procfile_lineword(ff, l, 5));
205 - d->tfifo = str2kernel_unit_t(procfile_lineword(ff, l, 13));
204 + d->rfifo = str2kernel_uint_t(procfile_lineword(ff, l, 5));
205 + d->tfifo = str2kernel_uint_t(procfile_lineword(ff, l, 13));
206 }
207
208 if(likely(d->do_compressed != CONFIG_ONDEMAND_NO)) {
209 - d->rcompressed = str2kernel_unit_t(procfile_lineword(ff, l, 7));
210 - d->tcompressed = str2kernel_unit_t(procfile_lineword(ff, l, 16));
209 + d->rcompressed = str2kernel_uint_t(procfile_lineword(ff, l, 7));
210 + d->tcompressed = str2kernel_uint_t(procfile_lineword(ff, l, 16));
211 }
212
213 if(likely(d->do_events != CONFIG_ONDEMAND_NO)) {
214 - d->rframe = str2kernel_unit_t(procfile_lineword(ff, l, 6));
215 - d->tcollisions = str2kernel_unit_t(procfile_lineword(ff, l, 14));
216 - d->tcarrier = str2kernel_unit_t(procfile_lineword(ff, l, 15));
214 + d->rframe = str2kernel_uint_t(procfile_lineword(ff, l, 6));
215 + d->tcollisions = str2kernel_uint_t(procfile_lineword(ff, l, 14));
216 + d->tcarrier = str2kernel_uint_t(procfile_lineword(ff, l, 15));
217 }
218
219 // --------------------------------------------------------------------