Skip to contentSkip to conversation

tools: print a warning for tools replaced by intel_reg

PATCH In review Thomas Wood 3 participants 5 messages Jun 10, 2015 – Jun 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: print a warning for tools replaced by intel_reg

---
 tools/intel_iosf_sb_read.c  | 3 +++
 tools/intel_iosf_sb_write.c | 3 +++
 tools/intel_reg_dumper.c    | 3 +++
 tools/intel_reg_read.c      | 3 +++
 tools/intel_reg_snapshot.c  | 4 ++++
 tools/intel_reg_write.c     | 3 +++
 tools/intel_vga_read.c      | 3 +++
 tools/intel_vga_write.c     | 3 +++
 8 files changed, 25 insertions(+)
tools/intel_iosf_sb_read.c +3 -0
index f188cda..097b0b8 100644
@@ -94,6 +94,9 @@ int main(int argc, char *argv[])
 	int i, nregs, count = 1, reg_stride;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_iosf_sb_write.c +3 -0
index eb6700d..a091a0d 100644
@@ -89,6 +89,9 @@ int main(int argc, char** argv)
 	int i, nregs;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_reg_dumper.c +3 -0
index 3d32005..f9b4d06 100644
@@ -2931,6 +2931,9 @@ int main(int argc, char** argv)
 	char *file = NULL, *reg_name = NULL;
 	uint32_t reg_val, power_well;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((opt = getopt(argc, argv, "d:h")) != -1) {
 		switch (opt) {
 		case 'd':
tools/intel_reg_read.c +3 -0
index 46fa664..39671ff 100644
@@ -74,6 +74,9 @@ int main(int argc, char** argv)
 	int decode_bits = 0;
 	int dwords = 1;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
 		switch(ch) {
 		case 'd':
tools/intel_reg_snapshot.c +4 -0
index 50dafd6..8b097e6 100644
@@ -26,6 +26,7 @@
 
 #include <unistd.h>
 #include <assert.h>
+#include <stdio.h>
 #include "intel_io.h"
 #include "intel_chipset.h"
 
@@ -36,6 +37,9 @@ int main(int argc, char** argv)
 	int mmio_bar;
 	int ret;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	pci_dev = intel_get_pci_device();
 	devid = pci_dev->device_id;
 	intel_mmio_use_pci_bar(pci_dev);
tools/intel_reg_write.c +3 -0
index b0ddffe..127519c 100644
@@ -36,6 +36,9 @@ int main(int argc, char** argv)
 {
 	uint32_t reg, value;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (argc < 3) {
 		printf("Usage: %s addr value\n", argv[0]);
 		printf("  WARNING: This is dangerous to you and your system's health.\n");
tools/intel_vga_read.c +3 -0
index ea50705..8305fb8 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int i, ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
tools/intel_vga_write.c +3 -0
index 8215962..cb1ed98 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
Signature · 6 lines
2.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 2 lines · Thomas Wood

I'd go even one step further and do an exec using the corresponding intel_reg commandline. On top of this patch ofc. Then we could nuke a lot of the existing boilerplate already and then perhaps nuke all the tools one release later on or so.
-Daniel

Quoted 138 lines
---
 tools/intel_iosf_sb_read.c  | 3 +++
 tools/intel_iosf_sb_write.c | 3 +++
 tools/intel_reg_dumper.c    | 3 +++
 tools/intel_reg_read.c      | 3 +++
 tools/intel_reg_snapshot.c  | 4 ++++
 tools/intel_reg_write.c     | 3 +++
 tools/intel_vga_read.c      | 3 +++
 tools/intel_vga_write.c     | 3 +++
 8 files changed, 25 insertions(+)
tools/intel_iosf_sb_read.c +3 -0
index f188cda..097b0b8 100644
@@ -94,6 +94,9 @@ int main(int argc, char *argv[])
 	int i, nregs, count = 1, reg_stride;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_iosf_sb_write.c +3 -0
index eb6700d..a091a0d 100644
@@ -89,6 +89,9 @@ int main(int argc, char** argv)
 	int i, nregs;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_reg_dumper.c +3 -0
index 3d32005..f9b4d06 100644
@@ -2931,6 +2931,9 @@ int main(int argc, char** argv)
 	char *file = NULL, *reg_name = NULL;
 	uint32_t reg_val, power_well;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((opt = getopt(argc, argv, "d:h")) != -1) {
 		switch (opt) {
 		case 'd':
tools/intel_reg_read.c +3 -0
index 46fa664..39671ff 100644
@@ -74,6 +74,9 @@ int main(int argc, char** argv)
 	int decode_bits = 0;
 	int dwords = 1;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
 		switch(ch) {
 		case 'd':
tools/intel_reg_snapshot.c +4 -0
index 50dafd6..8b097e6 100644
@@ -26,6 +26,7 @@
 
 #include <unistd.h>
 #include <assert.h>
+#include <stdio.h>
 #include "intel_io.h"
 #include "intel_chipset.h"
 
@@ -36,6 +37,9 @@ int main(int argc, char** argv)
 	int mmio_bar;
 	int ret;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	pci_dev = intel_get_pci_device();
 	devid = pci_dev->device_id;
 	intel_mmio_use_pci_bar(pci_dev);
tools/intel_reg_write.c +3 -0
index b0ddffe..127519c 100644
@@ -36,6 +36,9 @@ int main(int argc, char** argv)
 {
 	uint32_t reg, value;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (argc < 3) {
 		printf("Usage: %s addr value\n", argv[0]);
 		printf("  WARNING: This is dangerous to you and your system's health.\n");
tools/intel_vga_read.c +3 -0
index ea50705..8305fb8 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int i, ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
tools/intel_vga_write.c +3 -0
index 8215962..cb1ed98 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
Signature · 6 lines
2.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Daniel Vetter
Quoted 2 lines · Thomas Wood

I'd go even one step further and do an exec using the corresponding intel_reg commandline. On top of this patch ofc.

IMO more work than it's worth.

Quoted 2 lines

Then we could nuke a lot of the existing boilerplate already and then perhaps nuke all the tools one release later on or so.

Hmm didn't we already make a release with the warnings? I'd just nuke the deprecated ones from git now.

BR,
Jani.

Quoted 145 lines

-Daniel

Quoted 138 lines
---
 tools/intel_iosf_sb_read.c  | 3 +++
 tools/intel_iosf_sb_write.c | 3 +++
 tools/intel_reg_dumper.c    | 3 +++
 tools/intel_reg_read.c      | 3 +++
 tools/intel_reg_snapshot.c  | 4 ++++
 tools/intel_reg_write.c     | 3 +++
 tools/intel_vga_read.c      | 3 +++
 tools/intel_vga_write.c     | 3 +++
 8 files changed, 25 insertions(+)
tools/intel_iosf_sb_read.c +3 -0
index f188cda..097b0b8 100644
@@ -94,6 +94,9 @@ int main(int argc, char *argv[])
 	int i, nregs, count = 1, reg_stride;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_iosf_sb_write.c +3 -0
index eb6700d..a091a0d 100644
@@ -89,6 +89,9 @@ int main(int argc, char** argv)
 	int i, nregs;
 	const char *name;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (!IS_VALLEYVIEW(dev->device_id) &&
 	    !IS_CHERRYVIEW(dev->device_id)) {
 		usage(argv[0]);
tools/intel_reg_dumper.c +3 -0
index 3d32005..f9b4d06 100644
@@ -2931,6 +2931,9 @@ int main(int argc, char** argv)
 	char *file = NULL, *reg_name = NULL;
 	uint32_t reg_val, power_well;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((opt = getopt(argc, argv, "d:h")) != -1) {
 		switch (opt) {
 		case 'd':
tools/intel_reg_read.c +3 -0
index 46fa664..39671ff 100644
@@ -74,6 +74,9 @@ int main(int argc, char** argv)
 	int decode_bits = 0;
 	int dwords = 1;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
 		switch(ch) {
 		case 'd':
tools/intel_reg_snapshot.c +4 -0
index 50dafd6..8b097e6 100644
@@ -26,6 +26,7 @@
 
 #include <unistd.h>
 #include <assert.h>
+#include <stdio.h>
 #include "intel_io.h"
 #include "intel_chipset.h"
 
@@ -36,6 +37,9 @@ int main(int argc, char** argv)
 	int mmio_bar;
 	int ret;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	pci_dev = intel_get_pci_device();
 	devid = pci_dev->device_id;
 	intel_mmio_use_pci_bar(pci_dev);
tools/intel_reg_write.c +3 -0
index b0ddffe..127519c 100644
@@ -36,6 +36,9 @@ int main(int argc, char** argv)
 {
 	uint32_t reg, value;
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	if (argc < 3) {
 		printf("Usage: %s addr value\n", argv[0]);
 		printf("  WARNING: This is dangerous to you and your system's health.\n");
tools/intel_vga_read.c +3 -0
index ea50705..8305fb8 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int i, ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
tools/intel_vga_write.c +3 -0
index 8215962..cb1ed98 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
 	int ch;
 	const char *cmdname = argv[0];
 
+	fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+		" intel_reg.\n", argv[0]);
+
 	while ((ch = getopt(argc, argv, "m")) != -1) {
 		switch(ch) {
 		case 'm':
Signature · 6 lines
2.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 9 lines · Jani Nikula
Quoted 6 lines · Daniel Vetter
Quoted 2 lines · Thomas Wood

I'd go even one step further and do an exec using the corresponding intel_reg commandline. On top of this patch ofc.

IMO more work than it's worth.

I looked at this, but the output and options of intel_reg don't quite match those of tools it is replacing, so it's not an exact replacement.

Quoted 6 lines
Quoted 3 lines

Then we could nuke a lot of the existing boilerplate already and then perhaps nuke all the tools one release later on or so.

Hmm didn't we already make a release with the warnings? I'd just nuke the deprecated ones from git now.

Yes, the 1.11 release has the warnings.

Quoted 152 lines

BR,
Jani.

Quoted 136 lines

-Daniel

Quoted 134 lines
---
 tools/intel_iosf_sb_read.c  | 3 +++
 tools/intel_iosf_sb_write.c | 3 +++
 tools/intel_reg_dumper.c    | 3 +++
 tools/intel_reg_read.c      | 3 +++
 tools/intel_reg_snapshot.c  | 4 ++++
 tools/intel_reg_write.c     | 3 +++
 tools/intel_vga_read.c      | 3 +++
 tools/intel_vga_write.c     | 3 +++
 8 files changed, 25 insertions(+)
tools/intel_iosf_sb_read.c +3 -0
index f188cda..097b0b8 100644
@@ -94,6 +94,9 @@ int main(int argc, char *argv[])
     int i, nregs, count = 1, reg_stride;
     const char *name;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     if (!IS_VALLEYVIEW(dev->device_id) &&
         !IS_CHERRYVIEW(dev->device_id)) {
             usage(argv[0]);
tools/intel_iosf_sb_write.c +3 -0
index eb6700d..a091a0d 100644
@@ -89,6 +89,9 @@ int main(int argc, char** argv)
     int i, nregs;
     const char *name;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     if (!IS_VALLEYVIEW(dev->device_id) &&
         !IS_CHERRYVIEW(dev->device_id)) {
             usage(argv[0]);
tools/intel_reg_dumper.c +3 -0
index 3d32005..f9b4d06 100644
@@ -2931,6 +2931,9 @@ int main(int argc, char** argv)
     char *file = NULL, *reg_name = NULL;
     uint32_t reg_val, power_well;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     while ((opt = getopt(argc, argv, "d:h")) != -1) {
             switch (opt) {
             case 'd':
tools/intel_reg_read.c +3 -0
index 46fa664..39671ff 100644
@@ -74,6 +74,9 @@ int main(int argc, char** argv)
     int decode_bits = 0;
     int dwords = 1;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
             switch(ch) {
             case 'd':
tools/intel_reg_snapshot.c +4 -0
index 50dafd6..8b097e6 100644
@@ -26,6 +26,7 @@
 
 #include <unistd.h>
 #include <assert.h>
+#include <stdio.h>
 #include "intel_io.h"
 #include "intel_chipset.h"
 
@@ -36,6 +37,9 @@ int main(int argc, char** argv)
     int mmio_bar;
     int ret;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     pci_dev = intel_get_pci_device();
     devid = pci_dev->device_id;
     intel_mmio_use_pci_bar(pci_dev);
tools/intel_reg_write.c +3 -0
index b0ddffe..127519c 100644
@@ -36,6 +36,9 @@ int main(int argc, char** argv)
 {
     uint32_t reg, value;
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     if (argc < 3) {
             printf("Usage: %s addr value\n", argv[0]);
             printf("  WARNING: This is dangerous to you and your system's health.\n");
tools/intel_vga_read.c +3 -0
index ea50705..8305fb8 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
     int i, ch;
     const char *cmdname = argv[0];
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     while ((ch = getopt(argc, argv, "m")) != -1) {
             switch(ch) {
             case 'm':
tools/intel_vga_write.c +3 -1
index 8215962..cb1ed98 100644
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
     int ch;
     const char *cmdname = argv[0];
 
+    fprintf(stderr, "WARNING: Use of %s has been deprecated and replaced by"
+            " intel_reg.\n", argv[0]);
+
     while ((ch = getopt(argc, argv, "m")) != -1) {
             switch(ch) {
             case 'm':
--

2.4.2

Quoted 9 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Quoted 2 lines

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 17 lines · Thomas Wood
Quoted 9 lines · Jani Nikula
Quoted 6 lines · Daniel Vetter
Quoted 2 lines · Thomas Wood

I'd go even one step further and do an exec using the corresponding intel_reg commandline. On top of this patch ofc.

IMO more work than it's worth.

I looked at this, but the output and options of intel_reg don't quite match those of tools it is replacing, so it's not an exact replacement.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Then we could nuke a lot of the existing boilerplate already and then perhaps nuke all the tools one release later on or so.

Hmm didn't we already make a release with the warnings? I'd just nuke the deprecated ones from git now.

Yes, the 1.11 release has the warnings.

Ah in that case let's just move ahead and nuke them all. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx